mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
pre-commit: add error messages for style issues
This commit is contained in:
parent
933ff8d480
commit
5c0692e59e
@ -31,7 +31,7 @@ if [ "$allownonascii" != "true" ] &&
|
||||
test $(git diff --cached --name-only --diff-filter=A -z $against |
|
||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
||||
then
|
||||
echo "Error: Attempt to add a non-ascii file name."
|
||||
echo "Pre-commit style error: Attempt to add a non-ascii file name."
|
||||
echo
|
||||
echo "This can cause problems if you want to work"
|
||||
echo "with people on other platforms."
|
||||
@ -49,6 +49,7 @@ fi
|
||||
# If there are whitespace errors, print the offending file names and fail.
|
||||
git diff-index --check --cached $against --
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Pre-commit style error: Whitespace issues"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -58,6 +59,7 @@ 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user