diff --git a/.travis.yml b/.travis.yml index c5e1b5aa5..31d5c1028 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,6 @@ services: install: - go get github.com/constabulary/gb/... - go get github.com/client9/misspell/... - - go get github.com/alecthomas/gometalinter # Generate a self-signed X.509 certificate for TLS. before_script: diff --git a/hooks/pre-commit b/hooks/pre-commit index 56a864161..ec88170f4 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -2,8 +2,14 @@ set -eu +export GOPATH="$(pwd):$(pwd)/vendor" +export PATH="$PATH:$(pwd)/vendor/bin:$(pwd)/bin" + +echo "Installing lint search engine..." +go install github.com/alecthomas/gometalinter/ + echo "Looking for lint..." -GOPATH="$(pwd):$(pwd)/vendor" gometalinter --config=linter.json ./... +gometalinter --config=linter.json ./... echo "Double checking spelling..." misspell -error src *.md @@ -16,6 +22,6 @@ gb test # checks that everything builds. This seems to do a better job of handling # missing imports than `gb build` does. echo "Double checking it builds..." -GOPATH=$(pwd):$(pwd)/vendor go build github.com/matrix-org/dendrite/cmd/... +go build github.com/matrix-org/dendrite/cmd/... echo "Done!"