Skip to content

Commit

Permalink
Astyle: Changed from test failure to status note
Browse files Browse the repository at this point in the history
  • Loading branch information
geky authored and 0xc0170 committed Mar 15, 2018
1 parent ef9dbc5 commit 83b47ef
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,25 @@ matrix:
if [ $(cat astyle.out | grep Formatted | wc -l) -ne 0 ]; then
git --no-pager diff;
echo "Please fix style issues as shown above";
exit 1;
else
echo "Coding style check OK";
exit 0;
fi
after_success:
# update status if we succeeded, compare with master if possible
- |
CURR=$(cat astyle.out | grep Formatted | wc -l)
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
| capture(\", (?<warnings>[0-9]+) warnings\").warnings" \
|| echo 0)
STATUSM="Passed, ${CURR} warnings"
if [ "$PREV" -ne 0 ]
then
STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") warnings)"
fi
- bash -c "$STATUS" success "$STATUSM"

- env:
- NAME=events
Expand Down

0 comments on commit 83b47ef

Please sign in to comment.