2017-02-03 13:52:32 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
golint src/...
|
2017-06-12 18:30:47 +01:00
|
|
|
misspell -error src *.md
|
|
|
|
|
|
|
|
# gofmt doesn't exit with an error code if the files don't match the expected
|
|
|
|
# format. So we have to run it and see if it outputs anything.
|
|
|
|
if gofmt -l -s ./src/ 2>&1 | read
|
|
|
|
then
|
|
|
|
echo "Error: not all code had been formatted with gofmt."
|
|
|
|
echo "Fixing the following files"
|
|
|
|
gofmt -s -w -l ./src/
|
|
|
|
echo
|
|
|
|
echo "Please add them to the commit"
|
|
|
|
git status --short
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-05-18 12:27:11 +01:00
|
|
|
go tool vet --all --shadow ./src
|
2017-02-03 13:52:32 +00:00
|
|
|
gocyclo -over 12 src/
|
|
|
|
gb test
|
2017-05-23 09:12:59 +01:00
|
|
|
|
|
|
|
# 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/...
|