Skip to content

Commit 9dba5c6

Browse files
authored
Fix Default Option Settings When Deserializing Options Json (#610)
* Fix Default Option Settings When Deserializing Options Json OutputTextFormat and OutputFileFormat were defaulting to string.Empty when deserialized because the default set for instantiating differed from the default value used for command parsing. * Update Changelog.md
1 parent 97454b3 commit 9dba5c6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.33] - 2024-3-13
8+
### Fix
9+
Fixes properly setting the default value for the `OutputFileFormat` and `OutputTextFormat` fields when using the `options-json` argument to the analyze command.
10+
711
## [1.0.32] - 2024-3-04
812
### Pipeline
913
Improvement to pipeline to allow rerunning failed deploy jobs.

DevSkim-DotNet/Microsoft.DevSkim.CLI/Options/BaseAnalyzeCommandOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public record BaseAnalyzeCommandOptions : LogOptions
3131
public string CommentsPath { get; set; } = string.Empty;
3232

3333
[Option('o', "output-format", HelpText = "Format for output text.", Default = SimpleTextWriter.DefaultFormat)]
34-
public string OutputTextFormat { get; set; } = string.Empty;
34+
public string OutputTextFormat { get; set; } = SimpleTextWriter.DefaultFormat;
3535

3636
[Option('f', "file-format", HelpText = "Format type for output. [text|sarif]", Default = "sarif")]
37-
public string OutputFileFormat { get; set; } = string.Empty;
37+
public string OutputFileFormat { get; set; } = "sarif";
3838

3939
[Option('s', "severity", HelpText = "Comma-separated Severities to match", Separator = ',', Default = new[] { Severity.Critical, Severity.Important, Severity.Moderate, Severity.BestPractice, Severity.ManualReview })]
4040
public IEnumerable<Severity> Severities { get; set; } = new[] { Severity.Critical, Severity.Important, Severity.Moderate, Severity.BestPractice, Severity.ManualReview };

0 commit comments

Comments
 (0)