mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +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}"
|
cd "${KUBE_ROOT}"
|
||||||
|
|
||||||
|
# The config is in ${KUBE_ROOT}/.golangci.yaml
|
||||||
echo 'running golangci-lint '
|
echo 'running golangci-lint '
|
||||||
golangci-lint run \
|
if [[ "$#" > 0 ]]; then
|
||||||
--timeout 30m \
|
golangci-lint run "$@"
|
||||||
--disable-all \
|
else
|
||||||
-E deadcode \
|
golangci-lint run ./...
|
||||||
-E unused \
|
for d in staging/src/k8s.io/*; do
|
||||||
-E varcheck \
|
pushd ./vendor/k8s.io/$(basename "$d") >/dev/null
|
||||||
-E ineffassign \
|
golangci-lint run ./...
|
||||||
-E staticcheck
|
popd >/dev/null
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user