From 441bb918ecc2b97de90e44f27b2e5a0d932e6ebc Mon Sep 17 00:00:00 2001 From: "John C. Vernaleo" Date: Wed, 16 Nov 2016 16:00:41 -0500 Subject: [PATCH] Modify goclean to use gometalint like btcd --- .travis.yml | 4 ++-- goclean.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 662bf9af..e3128e11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ sudo: false install: - go get -d -t -v ./... - go get -v golang.org/x/tools/cmd/cover - - go get -v github.com/bradfitz/goimports - - go get -v github.com/golang/lint/golint + - go get -v github.com/alecthomas/gometalinter + - gometalinter --install script: - export PATH=$PATH:$HOME/gopath/bin - ./goclean.sh diff --git a/goclean.sh b/goclean.sh index 91833320..91ae7d79 100755 --- a/goclean.sh +++ b/goclean.sh @@ -5,14 +5,19 @@ # 3. golint (https://github.com/golang/lint) # 4. go vet (http://golang.org/cmd/vet) # 5. test coverage (http://blog.golang.org/cover) +# +# gometalinter (github.com/alecthomas/gometalinter) is used to run each each +# static checker. set -e # Automatic checks test -z "$(gofmt -l -w . | tee /dev/stderr)" -test -z "$(goimports -l -w . | tee /dev/stderr)" -test -z "$(golint . | tee /dev/stderr)" -go vet ./... +test -z "$(gometalinter --disable-all \ +--enable=golint \ +--enable=vet \ +--enable=goimports \ +--deadline=20s ./... | tee /dev/stderr)" env GORACE="halt_on_error=1" go test -v -race ./... # Run test coverage on each subdirectories and merge the coverage profile.