Skip to content

Commit

Permalink
gosec: add G602 analyzer (#4906)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Aug 14, 2024
1 parent 15529a9 commit ca0b09e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds

# To specify a set of rules to explicitly exclude.
# Available rules: https://github.com/securego/gosec#available-rules
Expand Down Expand Up @@ -914,7 +913,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds

# Exclude generated files
# Default: false
Expand Down
2 changes: 0 additions & 2 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds

# To specify a set of rules to explicitly exclude.
# Available rules: https://github.com/securego/gosec#available-rules
Expand Down Expand Up @@ -914,7 +913,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds

# Exclude generated files
# Default: false
Expand Down
3 changes: 1 addition & 2 deletions jsonschema/golangci.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@
"G503",
"G504",
"G505",
"G601",
"G602"
"G601"
]
},
"govet-analyzers": {
Expand Down
3 changes: 1 addition & 2 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@
"G503",
"G504",
"G505",
"G601",
"G602"
"G601"
]
},
"govet-analyzers": {
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/gosec/gosec.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func runGoSec(lintCtx *linter.Context, pass *analysis.Pass, settings *config.GoS
}

analyzer.CheckRules(pkg)
analyzer.CheckAnalyzers(pkg)

secIssues, _, _ := analyzer.Report()
if len(secIssues) == 0 {
Expand Down

0 comments on commit ca0b09e

Please sign in to comment.