Skip to content

Commit

Permalink
indentation test: handle removed files
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 7, 2015
1 parent 584771e commit c4ae8cd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/verify-indentation.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ git diff --name-only $TRAVIS_COMMIT_RANGE >>/tmp/ctest-important.log 2>&1


git diff --name-only $TRAVIS_COMMIT_RANGE | while read f git diff --name-only $TRAVIS_COMMIT_RANGE | while read f
do do
if ! [ -f "$f" ]; then
echo "$f was removed." >>/tmp/ctest-important.log
continue
fi

echo "Checking $f" >>/tmp/ctest-important.log echo "Checking $f" >>/tmp/ctest-important.log
case "$f" in case "$f" in
src/core/gps/qextserialport/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*) src/core/gps/qextserialport/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped echo "$f skipped"
continue continue
;; ;;


Expand All @@ -43,11 +48,11 @@ do
;; ;;
esac esac


m=$f.prepare m="$f.prepare"
cp "$f" "$m" cp "$f" "$m"
astyle.sh "$f" astyle.sh "$f"
if diff -u "$m" "$f" >>$ASTYLEDIFF; then if diff -u "$m" "$f" >>$ASTYLEDIFF; then
rm $m rm "$m"
else else
echo "File $f needs indentation" echo "File $f needs indentation"
fi fi
Expand Down

0 comments on commit c4ae8cd

Please sign in to comment.