Browse Source

pre-commit: fix indentation style

sbg
Matthias Grob 5 years ago committed by Daniel Agar
parent
commit
cc06009932
  1. 14
      Tools/astyle/pre-commit

14
Tools/astyle/pre-commit

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# An example hook script to verify what is about to be committed. # An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should # Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if # exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit. # it wants to stop the commit.
# #
@ -50,16 +50,16 @@ fi
git diff-index --check --cached $against -- git diff-index --check --cached $against --
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Pre-commit style error: Whitespace issues" echo "Pre-commit style error: Whitespace issues"
exit 1 exit 1
fi fi
# Check for code style, only in changed files # Check for code style, only in changed files
for i in `git diff --cached --name-only --diff-filter=ACM` for i in `git diff --cached --name-only --diff-filter=ACM`
do do
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh % ./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Pre-commit style error: Bad formatting according to astyle rules" echo "Pre-commit style error: Bad formatting according to astyle rules"
exit 1 exit 1
fi fi
done done

Loading…
Cancel
Save