Skip to content

Commit

Permalink
Fix Default Option Settings When Deserializing Options Json (#610)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gfs authored Mar 14, 2024
1 parent 97454b3 commit 9dba5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.33] - 2024-3-13
### Fix
Fixes properly setting the default value for the `OutputFileFormat` and `OutputTextFormat` fields when using the `options-json` argument to the analyze command.

## [1.0.32] - 2024-3-04
### Pipeline
Improvement to pipeline to allow rerunning failed deploy jobs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public record BaseAnalyzeCommandOptions : LogOptions
public string CommentsPath { get; set; } = string.Empty;

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

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

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

0 comments on commit 9dba5c6

Please sign in to comment.