forked from Archive/PX4-Autopilot
check_code_style don't create tmp files
This commit is contained in:
parent
701d177e23
commit
05b7dd0046
|
@ -6,12 +6,11 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|||
|
||||
if [ -f "$file" ];
|
||||
then
|
||||
${DIR}/fix_code_style.sh --quiet < $file > $file.pretty
|
||||
diffsize=$(diff -y --suppress-common-lines $file $file.pretty | wc -l)
|
||||
rm -f $file.pretty
|
||||
if [ $diffsize -ne 0 ]; then
|
||||
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
||||
exit 1
|
||||
fi
|
||||
${DIR}/fix_code_style.sh --dry-run $file | grep --quiet Formatted
|
||||
if [[ $? -eq 0 ]]
|
||||
then
|
||||
echo $file 'bad formatting, please run "./Tools/fix_code_style.sh' $file'"'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue