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
This commit is contained in:
20
support/pre-commit
Executable file
20
support/pre-commit
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/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
|
Reference in New Issue
Block a user