File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,21 @@ matrix:
105
105
popd;
106
106
- astyle --version
107
107
script :
108
- # only changed files to be checked for astyle
109
- - 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;
110
- if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
108
+ # only changed files this time
109
+ - 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-files-changed .out;
110
+ if [ $(cat astyle-files-changed .out | grep Formatted | wc -l) -ne 0 ]; then
111
111
git --no-pager diff;
112
112
echo "Please fix style issues as shown above";
113
113
else
114
114
echo "Coding style check OK";
115
115
fi
116
116
after_success :
117
+ # run astyle for all files on the branch
118
+ - git checkout -- .
119
+ - find -regex '.*\.\(h\|c\|hpp\|cpp\)' -type f | fgrep -v -f .astyleignore | xargs -n 100 -I {} bash -c "astyle -n --options=.astylerc \"{}\"" > astyle-branch.out;
117
120
# update status if we succeeded, compare with master if possible
118
121
- |
119
- CURR=$(cat astyle.out | grep Formatted | wc -l)
122
+ CURR=$(cat astyle-branch .out | grep Formatted | wc -l)
120
123
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
121
124
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
122
125
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
You can’t perform that action at this time.
0 commit comments