mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
pre-commit: fix indentation style
This commit is contained in:
committed by
Daniel Agar
parent
5c0692e59e
commit
cc06009932
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user