mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
indentation test: improve interpretation of commit ranges
This commit is contained in:
parent
4b72357875
commit
8949c4420e
@ -61,6 +61,7 @@ sudo apt-get install --force-yes --no-install-recommends --no-install-suggests \
|
||||
xvfb \
|
||||
python-pip \
|
||||
flip \
|
||||
jq \
|
||||
postgresql-9.1-postgis-2.1/precise # from ubuntugis-unstable, not pgdg
|
||||
|
||||
sudo -H pip install autopep8 # TODO when switching to trusty or above: replace python-pip with python-autopep8
|
||||
|
@ -9,8 +9,6 @@ if [ -z "$TRAVIS_COMMIT_RANGE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE/.../..}
|
||||
|
||||
if ! type -p astyle.sh >/dev/null; then
|
||||
echo astyle.sh not found
|
||||
exit 1
|
||||
@ -21,12 +19,17 @@ set -e
|
||||
ASTYLEDIFF=/tmp/astyle.diff
|
||||
>$ASTYLEDIFF
|
||||
|
||||
echo "Checking indentation in $TRAVIS_COMMIT_RANGE"
|
||||
echo "Checking indentation in $TRAVIS_COMMIT_RANGE" >>/tmp/ctest-important.log
|
||||
git log $TRAVIS_COMMIT_RANGE >>/tmp/ctest-important.log 2>&1
|
||||
git diff --name-only $TRAVIS_COMMIT_RANGE >>/tmp/ctest-important.log 2>&1
|
||||
case "${TRAVIS_COMMIT_RANGE}" in
|
||||
*...*)
|
||||
curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/compare/$TRAVIS_COMMIT_RANGE | jq -r .files[].filename >/tmp/changed-files
|
||||
;;
|
||||
|
||||
git diff --name-only $TRAVIS_COMMIT_RANGE | while read f
|
||||
*)
|
||||
git diff --name-only $TRAVIS_COMMIT_RANGE >/tmp/changed-files
|
||||
;;
|
||||
esac
|
||||
|
||||
while read f
|
||||
do
|
||||
if ! [ -f "$f" ]; then
|
||||
echo "$f was removed." >>/tmp/ctest-important.log
|
||||
@ -56,7 +59,7 @@ do
|
||||
else
|
||||
echo "File $f needs indentation"
|
||||
fi
|
||||
done
|
||||
done </tmp/changed-files
|
||||
|
||||
if [ -s "$ASTYLEDIFF" ]; then
|
||||
echo
|
||||
|
Loading…
x
Reference in New Issue
Block a user