File: pre-commit

package info (click to toggle)
mumax3 3.11.1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 10,668 kB
  • sloc: makefile: 194; ansic: 155; sh: 86; javascript: 16
file content (19 lines) | stat: -rwxr-xr-x 497 bytes parent folder | download | duplicates (3)
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