chore: bump golangci-lint to v2 (#2042)

This commit is contained in:
Nicholas Wiersma
2025-04-01 09:08:02 +02:00
committed by GitHub
parent ab1775afee
commit 1d91fa5d9b
8 changed files with 67 additions and 73 deletions
+61 -61
View File
@@ -1,86 +1,86 @@
version: "2"
run:
tests: false
timeout: 5m
linters-settings:
cyclop:
max-complexity: 12
skip-tests: true
errcheck:
exclude-functions:
- (*go.etcd.io/etcd/client/v3/concurrency.Mutex).Unlock
- (*go.etcd.io/etcd/client/v3/concurrency.Session).Close
gofumpt:
extra-rules: true
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
exclusions:
generated: lax
linters:
enable-all: true
default: all
disable:
- perfsprint # new
- testifylint # new
- spancheck # new
- rowserrcheck # new
- mnd # new
- intrange # new
- depguard # new
- revive # new
- errcheck # new
- cyclop
- depguard
- err113
- errcheck
- errchkjson
- exhaustive
- exhaustruct
- execinquery # deprecated
- exportloopref # deprecated
- forbidigo
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- godox
- err113
- gomnd
- intrange
- ireturn
- lll
- mnd
- musttag
- nilnil
- nlreturn
- nonamedreturns
- perfsprint
- recvcheck
- revive
- rowserrcheck
- spancheck
- tagliatelle
- testifylint
- varnamelen
- wrapcheck
- wsl
- cyclop # TODO: turn this back on later
- gocognit # TODO: turn this back on later
- forbidigo # TODO: turn this back on later
issues:
exclude-use-default: false
exclude:
- "package-comments: should have a package comment"
- "ST1000: at least one file in a package should have a package comment"
- "G204: Subprocess launched with a potential tainted input or cmd arguments"
- "G204: Subprocess launched with variable"
- "G402: TLS MinVersion too low."
- "const `op` is unused"
- "G115: integer overflow conversion int -> int32"
exclude-rules:
- path: cmd/proxy/main.go
text: "G108: Profiling endpoint is automatically exposed on /debug/pprof"
- path: pkg/stash/stasher.go
linters:
- contextcheck
- path: pkg/stash/with_azureblob.go # False positive
linters:
- bodyclose
- path: pkg/storage/azureblob/azureblob.go # False positive
linters:
- bodyclose
- path: pkg/storage/compliance/*
linters:
- thelper
- gosec
- errcheck
- path: pkg/index/compliance/*
linters:
- thelper
- gosec
- errcheck
settings:
cyclop:
max-complexity: 12
gosec:
excludes:
- G204
- G402
exclusions:
generated: lax
rules:
- path: cmd/proxy/main.go
text: 'G108: Profiling endpoint is automatically exposed on /debug/pprof'
- linters:
- contextcheck
path: pkg/stash/stasher.go
- linters:
- bodyclose
path: pkg/stash/with_azureblob.go
- linters:
- bodyclose
path: pkg/storage/azureblob/azureblob.go
- linters:
- gosec
- thelper
path: pkg/storage/compliance/*
- linters:
- thelper
path: pkg/index/compliance/*
- path: (.+)\.go$
text: 'package-comments: should have a package comment'
- path: (.+)\.go$
text: 'ST1000: at least one file in a package should have a package comment'
- path: (.+)\.go$
text: 'G115: integer overflow conversion int -> int32'