@@ -71,12 +71,12 @@ func NewGosec(settings *config.GoSecSettings) *goanalysis.Linter {
71
71
}
72
72
severity , err := convertToScore (settings .Severity )
73
73
if err != nil {
74
- lintCtx .Log .Warnf ("Provided severity %s , use low instead. Valid options: low, medium, high" , err )
74
+ lintCtx .Log .Warnf ("The provided severity %q is invalid , use low instead. Valid options: low, medium, high" , err )
75
75
}
76
76
77
77
confidence , err := convertToScore (settings .Confidence )
78
78
if err != nil {
79
- lintCtx .Log .Warnf ("Provided string %s , use low instead. Valid options: low, medium, high" , err )
79
+ lintCtx .Log .Warnf ("The provided confidence %q is invalid , use low instead. Valid options: low, medium, high" , err )
80
80
}
81
81
issues = filterIssues (issues , severity , confidence )
82
82
res := make ([]goanalysis.Issue , 0 , len (issues ))
@@ -137,6 +137,7 @@ func gosecRuleFilters(includes, excludes []string) []rules.RuleFilter {
137
137
return filters
138
138
}
139
139
140
+ // code borrowed from https://github.com/securego/gosec/blob/69213955dacfd560562e780f723486ef1ca6d486/cmd/gosec/main.go#L250-L262
140
141
func convertToScore (str string ) (gosec.Score , error ) {
141
142
str = strings .ToLower (str )
142
143
switch str {
@@ -151,6 +152,7 @@ func convertToScore(str string) (gosec.Score, error) {
151
152
}
152
153
}
153
154
155
+ // code borrowed from https://github.com/securego/gosec/blob/69213955dacfd560562e780f723486ef1ca6d486/cmd/gosec/main.go#L264-L276
154
156
func filterIssues (issues []* gosec.Issue , severity , confidence gosec.Score ) []* gosec.Issue {
155
157
res := make ([]* gosec.Issue , 0 )
156
158
for _ , issue := range issues {
0 commit comments