aboutsummaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2017-05-23 09:12:59 +0100
committerKegsay <kegsay@gmail.com>2017-05-23 09:12:59 +0100
commit309300a7447095bb6cbe82917cd41b64c6fa4ad1 (patch)
treeecf46cc505fdb32780dc8d7606f33d34b3922b57 /hooks
parenta7acfa5546e626735f4bb7200b73af1d36792fc7 (diff)
Call 'go build' from the pre-commit hook to check that everything builds (#116)
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/pre-commit6
1 files changed, 6 insertions, 0 deletions
diff --git a/hooks/pre-commit b/hooks/pre-commit
index 09970441..2853d60a 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 builds. 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/...