Files
NmraDcc/support/pre-commit
Alex Shepherd ad5ce96253 after making a mess of a PR from davidzuhn and not having the git skills to fix it, I've resorted to simply copying the desired files from his PR.
I've excluded his reformatted NmraDcc.h NmraDcc.cpp because there were too many merge conflicts now, so I'll reapply his formatting rules in another commit
2021-05-09 16:51:08 +12:00

21 lines
365 B
Bash
Executable File

#!/bin/sh
FORMAT_SOURCES="NmraDcc.h NmraDcc.cpp"
error=0
for file in ${FORMAT_SOURCES}
do
output=$(mktemp -t stylecheckXXXXXXX)
astyle --options=.astylerc < $file > $output
if ! cmp -s $file $output
then
echo "Formatting on $file doesn't match expectations"
diff -u $file $output
error=1
fi
[ -f $output ] && rm $output
done
exit $error