mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Move golangci-lint config to a file
Make verify-golangci-lint.sh work across modules and take an optional argument for a package.
This commit is contained in:
parent
e78b3e8dfe
commit
3bca4e6d67
18
.golangci.yaml
Normal file
18
.golangci.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
run:
|
||||
timeout: 30m
|
||||
skip-files:
|
||||
- "^zz_generated.*"
|
||||
|
||||
issues:
|
||||
max-same-issues: 0
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
enable: # please keep this alphabetized
|
||||
- deadcode
|
||||
- ineffassign
|
||||
- unused
|
||||
- varcheck
|
||||
linters-settings: # please keep this alphabetized
|
||||
unused:
|
||||
go: "1.17"
|
@ -43,12 +43,15 @@ popd >/dev/null
|
||||
|
||||
cd "${KUBE_ROOT}"
|
||||
|
||||
# The config is in ${KUBE_ROOT}/.golangci.yaml
|
||||
echo 'running golangci-lint '
|
||||
golangci-lint run \
|
||||
--timeout 30m \
|
||||
--disable-all \
|
||||
-E deadcode \
|
||||
-E unused \
|
||||
-E varcheck \
|
||||
-E ineffassign \
|
||||
-E staticcheck
|
||||
if [[ "$#" > 0 ]]; then
|
||||
golangci-lint run "$@"
|
||||
else
|
||||
golangci-lint run ./...
|
||||
for d in staging/src/k8s.io/*; do
|
||||
pushd ./vendor/k8s.io/$(basename "$d") >/dev/null
|
||||
golangci-lint run ./...
|
||||
popd >/dev/null
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user