Skip to content

Commit

Permalink
fix default config parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
yushindkang committed Feb 15, 2024
1 parent 8b60532 commit a173ba5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/parser/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const DefaultSeverityThreshold = models.SeverityMedium

func NewDefaultConfig() *models.Configuration {
return &models.Configuration{
SeverityThreshold: DefaultSeverityThreshold,
SeverityThreshold: "",
IgnoreDirs: []string{},
IgnorePaths: []string{},
Code: models.Code{},
Expand Down
4 changes: 4 additions & 0 deletions pkg/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func ParseConfiguration(data []byte) (*models.Configuration, error) {
}

func sanitizeConfig(config *models.Configuration) {
if config.SeverityThreshold == "" {
config.SeverityThreshold = DefaultSeverityThreshold
}

config.SeverityThreshold = strings.ToUpper(config.SeverityThreshold)
if config.SeverityThreshold == "" {
config.SeverityThreshold = DefaultSeverityThreshold
Expand Down

0 comments on commit a173ba5

Please sign in to comment.