2016-11-29 16:44:19 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
golint
|
2017-06-12 18:37:49 +00:00
|
|
|
misspell --error .
|
|
|
|
|
|
|
|
# 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 . 2>&1 | read
|
|
|
|
then
|
|
|
|
echo "Error: not all code had been formatted with gofmt."
|
|
|
|
echo "Fixing the following files"
|
|
|
|
gofmt -s -w -l .
|
|
|
|
echo
|
|
|
|
echo "Please add them to the commit"
|
|
|
|
git status --short
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ineffassign .
|
|
|
|
|
2016-11-29 16:44:19 +00:00
|
|
|
go fmt
|
2017-01-06 15:33:33 +00:00
|
|
|
go tool vet --all --shadow .
|
2016-11-29 16:44:19 +00:00
|
|
|
gocyclo -over 12 .
|
|
|
|
go test -timeout 5s -test.v
|