mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
Add varcheck to presubmit.
This commit is contained in:
@@ -8,6 +8,7 @@ go:
|
|||||||
before_install:
|
before_install:
|
||||||
- source ./bin/consider-early-travis-exit.sh
|
- source ./bin/consider-early-travis-exit.sh
|
||||||
- sudo apt-get install tree
|
- sudo apt-get install tree
|
||||||
|
- go get -u github.com/opennota/check/cmd/varcheck
|
||||||
- go get -u github.com/golang/lint/golint
|
- go get -u github.com/golang/lint/golint
|
||||||
- go get -u golang.org/x/tools/cmd/goimports
|
- go get -u golang.org/x/tools/cmd/goimports
|
||||||
- go get -u github.com/onsi/ginkgo/ginkgo
|
- go get -u github.com/onsi/ginkgo/ginkgo
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ function testGoLint {
|
|||||||
diff -u <(echo -n) <(go_dirs | xargs -0 golint --min_confidence 0.85 )
|
diff -u <(echo -n) <(go_dirs | xargs -0 golint --min_confidence 0.85 )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Not using the 'goimports' check because it reports hyphens in imported
|
||||||
|
# package names as errors, and we vendor in packages that have
|
||||||
|
# hyphens in their names.
|
||||||
function testGoMetalinter {
|
function testGoMetalinter {
|
||||||
diff -u <(echo -n) <(go_dirs | xargs -0 gometalinter.v2 --disable-all --deadline 5m \
|
diff -u <(echo -n) <(go_dirs | xargs -0 gometalinter.v2 --disable-all --deadline 5m \
|
||||||
--enable=misspell \
|
--enable=misspell \
|
||||||
--enable=structcheck \
|
--enable=structcheck \
|
||||||
--enable=deadcode \
|
--enable=deadcode \
|
||||||
# Disabling 'goimports' because it reports hyphens in imported package \
|
|
||||||
# names as errors, and we have to vendor them in regardless. \
|
|
||||||
# --enable=goimports \
|
|
||||||
--enable=varcheck \
|
--enable=varcheck \
|
||||||
--enable=goconst \
|
--enable=goconst \
|
||||||
--enable=unparam \
|
--enable=unparam \
|
||||||
@@ -60,7 +60,6 @@ function testGoMetalinter {
|
|||||||
--dupl-threshold=400 --enable=dupl)
|
--dupl-threshold=400 --enable=dupl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function testGoVet {
|
function testGoVet {
|
||||||
go vet -all ./...
|
go vet -all ./...
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user