From c453749f7aec170c4ea1641a7f0ede04df159fda Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 27 Feb 2018 11:09:06 +0100 Subject: [PATCH] :wrench: PHPCS: don't ignore warnings, don't list scanned files The `-n` flag will ignore warnings completely, while often it is useful to see them and to fix them. Using `--runtime-set ignore_warnings_on_exit 1` in the Travis script instead, warnings will be shown, both when a developer runs PHPCS on their own machine, as well as in Travis, but warnings will not cause a failed Travis build. The `-v` flag will list each file being scanned. This is intended for debugging purposes and not needed for normal use. --- .travis.yml | 2 +- phpcs.xml.dist | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 182a5677..cb3b4105 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ script: # @link https://pear.php.net/package/PHP_CodeSniffer/ # Uses a custom ruleset based on WordPress. This ruleset is automatically # picked up by PHPCS as it's named `phpcs.xml(.dist)`. - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/bin/phpcs --runtime-set ignore_warnings_on_exit 1; fi # Receive notifications for build results. # @link https://docs.travis-ci.com/user/notifications/#Email-notifications diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c8e95d43..69e0c59f 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -19,10 +19,8 @@ - +