3 export SCRIPT_BASE
=$
(dirname `readlink -f $0`)
4 export BASE
=${SCRIPT_BASE}/..
6 # search for a suitable clang-format version
7 CLANG_FORMAT_BIN
=`which clang-format-10`
8 if [ ! -x ${CLANG_FORMAT_BIN} ] ; then
9 echo "error: clang-format not found. abort."
16 for fn
in $
(find src include
test examples
-type f
-name "*.[ch]pp") ; do
17 if [ "$(${CLANG_FORMAT_BIN} "$fn" | diff "$fn" -)" ] ; then
22 # abort commit and show violating files
23 if [ ${#FILES[@]} -gt 0 ] ; then
24 for fn
in ${FILES[@]} ; do