Skip to content

Commit 9d095ce

Browse files
Copilotbaynezy
andauthored
Fix SonarQube S6664: Reduce Information logging calls in WriteJsonCommand.cs (#231)
* Initial plan * Initial analysis - identified SonarQube S6664 violation in WriteJsonCommand.cs Co-authored-by: baynezy <[email protected]> * Fix SonarQube S6664: Reduce Information logging calls from 3 to 2 in WriteJsonCommand.cs Co-authored-by: baynezy <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: baynezy <[email protected]> Co-authored-by: Simon Baynes <[email protected]>
1 parent a3ef070 commit 9d095ce

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,6 @@ fabric.properties
9696
#Verify
9797
*.received.txt
9898

99-
# Test results
100-
TestResults/
99+
# Test Results
100+
TestResults/
101+
**/TestResults/

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Set up copilot environment (#225)
1515
- Updated Dockerfile to use uppercase 'AS' in multi-stage builds for SonarQube compliance (#229)
1616

17+
### Fixed
18+
19+
- Reduced Information logging calls in WriteJsonCommand.cs to comply with SonarQube rule S6664 (#230)
20+
1721
## [1.1.1.16] - 2025-06-06
1822

1923
### Fixed

src/SemVer.Json/Features/WriteJsonFile/WriteJsonCommand.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public class WriteJsonCommand(IFileWriter fileWriter, ILogger<WriteJsonCommand>
1313

1414
public int Write(WriteJsonOptions options)
1515
{
16-
logger.LogInformation("Version Number to write: {Major}.{Minor}.{Patch}.{Build}", options.Major, options.Minor, options.Patch, options.Build);
17-
1816
var semVer = new SemVer
1917
{
2018
Major = options.Major,
@@ -24,7 +22,7 @@ public int Write(WriteJsonOptions options)
2422
};
2523
var json = JsonSerializer.Serialize(semVer, _jsonSerializerOptions);
2624

27-
logger.LogInformation("Json to write: {Json}", json);
25+
logger.LogInformation("Writing version {Major}.{Minor}.{Patch}.{Build} as JSON: {Json}", options.Major, options.Minor, options.Patch, options.Build, json);
2826
logger.LogInformation("Writing to file: {Path}", options.Path);
2927

3028
fileWriter.WriteJson(json, options.Path);

0 commit comments

Comments
 (0)