0
0
mirror of https://github.com/thegeeklab/wp-matrix.git synced 2024-11-12 17:20:40 +00:00
wp-matrix/vendor/github.com/matrix-org/gomatrix/hooks/pre-commit
2018-01-08 09:54:13 +01:00

27 lines
532 B
Bash
Executable File

#! /bin/bash
set -eu
golint
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 .
go fmt
go tool vet --all --shadow .
gocyclo -over 12 .
go test -timeout 5s -test.v