File: pre-commit

package info (click to toggle)
iqtree 2.0.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 14,620 kB
  • sloc: cpp: 142,571; ansic: 57,789; sh: 275; python: 242; makefile: 95
file content (37 lines) | stat: -rwxr-xr-x 694 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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

# link this file in your git-hooks, for example with:
#      ln .git/hooks/pre-commit pre-commit

if ./scripts/format.sh check
then
	echo "nothing to format"
else
	echo "unformatted files, please format and stage again" >&2
	exit 1
fi

if lizard include lib app test &> "/dev/null"; then
	echo "no overcomplicated functions found"
else
	echo "lizard-warnings found... aborting" >&2
	exit 1
fi

cd "build/debug" 
if ninja ;then
	echo "debug-build successfull"
else
	echo "build-failure... aborting" >&2
	exit 2
fi
cd "../.."

cd "build/debug" 
if ninja test &> "/dev/null";then
	echo "unit-tests run succesfully"
else
	echo "unit-tests failed... aborting" >&2
	exit 2
fi
cd "../.."