travis: fix commit content

pull/6590/head
Martin Kojtal 2018-04-10 15:59:04 +01:00
parent 2cd0b8143e
commit 6d427eaea1
1 changed files with 1 additions and 9 deletions

View File

@ -106,15 +106,7 @@ matrix:
- astyle --version
script:
# only changed files to be checked for astyle
- COMMIT_RANGE=${TRAVIS_COMMIT_RANGE/.../..}
- if [! git diff --quiet "$COMMIT_RANGE" -- ]
then
COMMIT_CONTENT=`git diff-tree --no-commit-id --name-only -r $TRAVIS_COMMIT`
else
COMMIT_CONTENT=`git diff --name-only $COMMIT_RANGE`
fi
- echo $COMMIT_CONTENT
- find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | $COMMIT_CONTENT | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out;
- git diff --name-only $TRAVIS_BRANCH | grep '.*\.\(h\|c\|hpp\|cpp\)' | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle.out;
if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
git --no-pager diff;
echo "Please fix style issues as shown above";