summaryrefslogtreecommitdiff
path: root/pre-commit.sh
blob: bebe9d903d59ef970b229a3e78d44a9fcbb9fe96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Ensure no doxygen errors
if which doxygen >/dev/null 2>/dev/null; then
	doxygen || exit 1
	cd cpp
	doxygen || exit 1
	cd ..
fi

make -j`nproc` test || exit 1

if [ "$NO_TIDY" = '' ] && which clang-tidy >/dev/null; then
	for file in pom.c cpp/pom.cpp; do
		if git diff --name-status HEAD -- $file | grep -q 'M\s*'"$file"; then
			echo "clang-tidy $file..."
			clang-tidy $file || exit 1
		fi
	done
fi