lint: Add golangci based on kubernetes/kubernetes.

Adapted the "strict" settings, but removed a few exclusions that
aren't relevant here (e.g. zz_generated), and removed the custom
logcheck linter (as we aren't currently using structured logging).
This commit is contained in:
justinsb 2023-07-29 16:37:07 -04:00 committed by Tim Hockin
parent 8656ab6183
commit f602004cd4
1 changed files with 26 additions and 0 deletions

26
.golangci.yaml Normal file
View File

@ -0,0 +1,26 @@
# This file configures checks that all new code for Kubernetes is meant to
# pass, in contrast to .golangci.yaml which defines checks that also the
# existing code passes.
run:
timeout: 30m
linters:
disable-all: false
enable: # please keep this alphabetized
- ginkgolinter
- gocritic
- govet
- ineffassign
# Should we add logcheck, for consistency with kubernetes/kubernetes?
# - logcheck
- staticcheck
- stylecheck
- unused
linters-settings: # please keep this alphabetized
gocritic:
staticcheck:
checks:
- "all"
stylecheck: