File tree 2 files changed +20
-3
lines changed
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -797,6 +797,20 @@ linters-settings:
797
797
798
798
# To specify the configuration of rules.
799
799
config :
800
+ # Globals are applicable to all rules.
801
+ global :
802
+ # If true, ignore #nosec in comments (and an alternative as well).
803
+ # Default: false
804
+ nosec : true
805
+ # Add an alternative comment prefix to #nosec (both will work at the same time).
806
+ # Default: ""
807
+ " #nosec " : " #my-custom-nosec"
808
+ # Define whether nosec issues are counted as finding or not.
809
+ # Default: false
810
+ show-ignored : true
811
+ # Audit mode enables addition checks that for normal code analysis might be too nosy.
812
+ # Default: false
813
+ audit : true
800
814
G101 :
801
815
# Regexp pattern for variables and constants to find.
802
816
# Default: "(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred"
Original file line number Diff line number Diff line change @@ -34,9 +34,12 @@ func NewGosec(settings *config.GoSecSettings) *goanalysis.Linter {
34
34
filters = gosecRuleFilters (settings .Includes , settings .Excludes )
35
35
36
36
for k , v := range settings .Config {
37
- // Uses ToUpper because the parsing of the map's key change the key to lowercase.
38
- // The value is not impacted by that: the case is respected.
39
- conf .Set (strings .ToUpper (k ), v )
37
+ if k != gosec .Globals {
38
+ // Uses ToUpper because the parsing of the map's key change the key to lowercase.
39
+ // The value is not impacted by that: the case is respected.
40
+ k = strings .ToUpper (k )
41
+ }
42
+ conf .Set (k , v )
40
43
}
41
44
}
42
45
You can’t perform that action at this time.
0 commit comments