3 # search for a suitable clang-format version
5 if [ `which clang-format-3.7` ] ; then
6 CLANG_FORMAT_BIN
=`which clang-format-3.7`
9 # clang format found, performing checks
10 if [ -x ${CLANG_FORMAT_BIN} ] ; then
12 for fn
in $
(find src
test examples
-type f
-name "*.[ch]pp") ; do
13 d
=$
(${CLANG_FORMAT_BIN} $fn |
diff $fn -)
14 if [ "x${d}" != "x" ] ; then
19 # abort commit and show violating files
20 if [ ${#FILES[@]} -gt 0 ] ; then
21 echo "error: files not formatted correctly:"
22 for fn
in ${FILES[@]} ; do