Files
podman/.golangci.yml
Kir Kolyshkin c72526cd9c .golangci.yml: switch to list of enabled linters
Instead of enabling all linters, and when disabling some of them because
we don't like them, switch to list of explicitly enabled linters. The
upside of this is we can easily upgrade golangci-lint (i.e. any new
linters won't break our CI). The downside is, we need to explicitly
enable extra linters.

To me, this is better from the maintainability perspective.

NOTE this commit does not change the configuration in any way, in other
words, the list of linters being run is the same as before. The next
commit will address this.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-31 12:27:55 -07:00

97 lines
1.7 KiB
YAML

---
run:
concurrency: 6
timeout: 5m
modules-download-mode: readonly
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- decorder
- dogsled
- durationcheck
- errcheck
- errchkjson
- exptostd
- fatcontext
- ginkgolinter
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- gofmt
- goheader
- goimports
- gomodguard
- goprintffuncname
- gosimple
- govet
- grouper
- iface
- importas
- inamedparam
- ineffassign
- interfacebloat
- loggercheck
- makezero
- mirror
- misspell
- nilerr
- nilnesserr
- nolintlint
- nosprintfhostport
- prealloc
- promlinter
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
- stylecheck
- testableexamples
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace
- zerologlint
linters-settings:
errcheck:
check-blank: false
nolintlint:
allow-unused: true
require-specific: true
revive:
rules:
- name: unused-parameter
disabled: true
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
exclude-dirs-use-default: true
exclude-dirs:
- contrib
- dependencies
exclude-files:
- swagger.go
exclude-rules:
# Exclude recvcheck from running on the imported k8s files, to much failures
- path: pkg/k8s.io/
linters:
- recvcheck