mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 06:43:34 +08:00
astyle scripting move to Tools/astyle
This commit is contained in:
committed by
Lorenz Meier
parent
a02caff1bc
commit
9f15c572a3
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
FILE=$1
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
if [ -f "$FILE" ]; then
|
||||
${DIR}/fix_code_style.sh --dry-run $FILE | grep --quiet Formatted
|
||||
if [[ $? -eq 0 ]]; then
|
||||
${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty
|
||||
|
||||
echo
|
||||
git --no-pager diff --no-index --minimal --histogram --color=always $FILE $FILE.pretty
|
||||
rm -f $FILE.pretty
|
||||
echo
|
||||
|
||||
if [[ $PX4_ASTYLE_FIX -eq 1 ]]; then
|
||||
${DIR}/fix_code_style.sh $FILE
|
||||
else
|
||||
echo $FILE 'bad formatting, please run "make format" or "./Tools/astyle/fix_code_style.sh' $FILE'"'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user