Commit c188a44b by Torkel Ödegaard Committed by GitHub

Merge pull request #14969 from grafana/gotmetalinter-script

Gometalinter changes & megacheck fix
parents d8430448 829e3024
...@@ -81,20 +81,9 @@ jobs: ...@@ -81,20 +81,9 @@ jobs:
working_directory: /go/src/github.com/grafana/grafana working_directory: /go/src/github.com/grafana/grafana
steps: steps:
- checkout - checkout
- run: 'go get -u github.com/alecthomas/gometalinter' - run:
- run: 'go get -u github.com/tsenart/deadcode' name: Gometalinter tests
- run: 'go get -u github.com/jgautheron/goconst/cmd/goconst' command: './scripts/gometalinter.sh'
- run: 'go get -u github.com/gordonklaus/ineffassign'
- run: 'go get -u honnef.co/go/tools/cmd/megacheck'
- run: 'go get -u github.com/opennota/check/cmd/structcheck'
- run: 'go get -u github.com/mdempsky/unconvert'
- run: 'go get -u github.com/opennota/check/cmd/varcheck'
- run:
name: run linters
command: 'gometalinter --enable-gc --vendor --deadline 10m --disable-all --enable=deadcode --enable=goconst --enable=gofmt --enable=ineffassign --enable=megacheck --enable=structcheck --enable=unconvert --enable=varcheck ./...'
- run:
name: run go vet
command: 'go vet ./pkg/...'
test-frontend: test-frontend:
docker: docker:
......
#!/bin/bash
function exit_if_fail {
command=$@
echo "Executing '$command'"
eval $command
rc=$?
if [ $rc -ne 0 ]; then
echo "'$command' returned $rc."
exit $rc
fi
}
go get -u github.com/alecthomas/gometalinter
go get -u github.com/tsenart/deadcode
go get -u github.com/jgautheron/goconst/cmd/goconst
go get -u github.com/gordonklaus/ineffassign
go get -u github.com/opennota/check/cmd/structcheck
go get -u github.com/mdempsky/unconvert
go get -u github.com/opennota/check/cmd/varcheck
go get -u honnef.co/go/tools/cmd/staticcheck
exit_if_fail gometalinter --enable-gc --vendor --deadline 10m --disable-all \
--enable=deadcode \
--enable=goconst \
--enable=gofmt \
--enable=ineffassign \
--enable=structcheck \
--enable=unconvert \
--enable=varcheck \
--enable=staticcheck
exit_if_fail go vet ./pkg/...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment