mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
pre-commit hook: show all style issues, not just the ones from the first file
This commit is contained in:
committed by
Daniel Agar
parent
2716ce7a56
commit
6938d24ec7
@@ -54,12 +54,9 @@ if [ $? -ne 0 ]; then
|
||||
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
|
||||
echo "Pre-commit style error: Bad formatting according to astyle rules"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
bash -c "comm -12 <(./Tools/astyle/files_to_check_code_style.sh | sort) <(git diff --cached --name-only --diff-filter=ACM) | xargs -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
|
||||
|
||||
Reference in New Issue
Block a user