Skip to content

Commit

Permalink
CI: use golangci-lint 1.57 (#2916)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Mar 26, 2024
1 parent df13f43 commit be97466
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.56
version: v1.57
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.56
version: v1.57
args: --issues-exit-code=1 --timeout 10m
only-new-issues: false
# the cache is already managed above, enabling it here
Expand Down
24 changes: 13 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

run:
skip-dirs:
- pkg/time/rate
skip-files:
- pkg/yamlpatch/merge.go
- pkg/yamlpatch/merge_test.go

linters-settings:
cyclop:
# lower this after refactoring
Expand All @@ -19,6 +12,10 @@ linters-settings:
- prefix(github.com/crowdsecurity)
- prefix(github.com/crowdsecurity/crowdsec)

gomoddirectives:
replace-allow-list:
- golang.org/x/time/rate

gocognit:
# lower this after refactoring
min-complexity: 145
Expand All @@ -40,7 +37,6 @@ linters-settings:
statements: 122

govet:
check-shadowing: true
enable:
- atomicalign
- deepequalerrors
Expand Down Expand Up @@ -295,15 +291,21 @@ issues:
# “Look, that’s why there’s rules, understand? So that you think before you
# break ‘em.” ― Terry Pratchett

exclude-dirs:
- pkg/time/rate

exclude-files:
- pkg/yamlpatch/merge.go
- pkg/yamlpatch/merge_test.go

exclude-generated-strict: true

max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:

# Won't fix:

- path: go.mod
text: "replacement are not allowed: golang.org/x/time/rate"

# `err` is often shadowed, we may continue to do it
- linters:
- govet
Expand Down

0 comments on commit be97466

Please sign in to comment.