1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#!/bin/sh
#
# A hook script to verify what is about to be committed.
# Called by git-commit with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# Add this file to .git/hooks
#
# Runs gofmt on the code and stops commit if files were affected.
#
fail=0;
if (gofmt -w -l */*.go */*/*.go | grep \.go); then exit 1; fi;
make || exit 1
#if astyle --indent=tab cuda/*.cu | grep Formatted; then exit 1; fi;
exit 0
|