From c21c113e71de3cb288d0c5879df835ce581b5b9c Mon Sep 17 00:00:00 2001 From: cpanato Date: Fri, 11 Apr 2025 15:46:12 +0200 Subject: [PATCH] upgrade golangci-lint to v2 Signed-off-by: cpanato --- .golangci.yaml | 54 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 6e12d960..c1b0fdfd 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,35 +1,47 @@ -run: - timeout: 5m - -issues: - exclude-rules: - - path: test # Excludes /test, *_test.go etc. - linters: - - gosec - +version: "2" linters: enable: - asciicheck - errorlint - - gofmt - gosec - - goimports - importas + - misspell - prealloc - revive - - misspell - - stylecheck + - staticcheck - tparallel - unconvert - unparam - whitespace - disable: - - errcheck - depguard - -linters-settings: - gosec: - excludes: - # TODO: Check those example in pkg/caps/caps.go:131 - - G115 # Potential integer overflow when converting between integer types + - errcheck + settings: + gosec: + excludes: + - G115 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - gosec + path: test + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$