forked from Archive/PX4-Autopilot
pre-commit: fix indentation style
This commit is contained in:
parent
5c0692e59e
commit
cc06009932
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 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
|
||||
# it wants to stop the commit.
|
||||
#
|
||||
|
@ -50,16 +50,16 @@ fi
|
|||
git diff-index --check --cached $against --
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Pre-commit style error: Whitespace issues"
|
||||
exit 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for code style, only in changed files
|
||||
for i in `git diff --cached --name-only --diff-filter=ACM`
|
||||
do
|
||||
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh %
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Pre-commit style error: Bad formatting according to astyle rules"
|
||||
exit 1
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue