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

# Ensure no doxygen errors
which doxygen >/dev/null 2>/dev/null && { doxygen || exit 1; }

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