Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gosec: add G602 analyzer #4906

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading