From 0d353e1c0c996b5534d6c72bce2ee84bdfe05360 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 12 Jun 2017 00:11:53 +0200 Subject: [PATCH] Rename the PHPCS ruleset. If the file is called `phpcs.xml` or `phpcs.xml.dist`, it is automatically picked up by PHPCS. A `phpcs.xml` is given preference over a `phpcs.xml.dist` file. So renaming the file to `phpcs.xml.dist` allows for people to use the file provided by `_s` if they choose not to add their own, but also leaves people the freedom to easily overrule it. --- .travis.yml | 5 +++-- codesniffer.ruleset.xml => phpcs.xml.dist | 0 2 files changed, 3 insertions(+), 2 deletions(-) rename codesniffer.ruleset.xml => phpcs.xml.dist (100%) diff --git a/.travis.yml b/.travis.yml index 91b7ffc2..c23feb07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,9 +83,10 @@ script: # -s flag: Show sniff codes in all reports. # -v flag: Print verbose output. # -n flag: Do not print warnings. (shortcut for --warning-severity=0) - # --standard: Use WordPress as the standard. + # Uses a custom ruleset based on WordPress. This ruleset is automatically + # picked up by PHPCS as it's named `phpcs.xml(.dist)`. # --extensions: Only sniff PHP files. - - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php; fi + - if [[ "$SNIFF" == "1" ]]; then $PHPCS_DIR/scripts/phpcs -p -s -v -n . --extensions=php; fi # Receive notifications for build results. # @link http://docs.travis-ci.com/user/notifications/#Email-notifications diff --git a/codesniffer.ruleset.xml b/phpcs.xml.dist similarity index 100% rename from codesniffer.ruleset.xml rename to phpcs.xml.dist