$ if [ ! -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then phpcs-diff $TRAVIS_BRANCH; else echo "This test does not derive from a pull-request. Unable to run phpcs-diff."; fi;
########## START OF PHPCS CHECK ##########
module/MyModule/src/MyClass/Something.php
- Line 179 (WARNING) Line exceeds 120 characters; contains 184 characters
- Line 202 (WARNING) Line exceeds 120 characters; contains 179 characters
- Line 237 (WARNING) Line exceeds 120 characters; contains 155 characters
- Line 251 (ERROR) Multi-line function call not indented correctly; expected 32 spaces but found 40
- Line 251 (ERROR) Closing parenthesis of a multi-line function call must be on a line by itself
########### END OF PHPCS CHECK ###########
The command "if [ ! -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then phpcs-diff $TRAVIS_BRANCH; else echo "This test does not derive from a pull-request. Unable to run phpcs-diff."; fi;" exited with 0.
Example from a Travis CI console output:
The issue here is https://github.com/olivertappin/phpcs-diff/blob/master/src/PhpcsDiff.php#L187 does not return a non-zero exit code when showing the violations.
An alternative (in the mean time) could be to validate the success response: