From 93279584fdd4e4fc8e29ff96074339e4f94fd030 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Mon, 22 May 2017 19:44:55 +0100 Subject: [PATCH] Call 'go build' from the pre-commit hook to check that everything builds --- hooks/pre-commit | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hooks/pre-commit b/hooks/pre-commit index 099704410..d088e742a 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -7,3 +7,9 @@ go fmt ./src/... go tool vet --all --shadow ./src gocyclo -over 12 src/ gb test + +# Check that all the packages can build. +# When go build is given multiple packages it won't output anything, and just +# checks that everything build. This seems to do a better job of handling +# missing imports than `gb build` does. +GOPATH=$(pwd):$(pwd)/vendor go build github.com/matrix-org/dendrite/cmd/...