forked from mirror/_s
🔧 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.
This commit is contained in:
parent
92d8673e4a
commit
c453749f7a
|
@ -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
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
<!-- Pass some flags to PHPCS:
|
||||
p flag: Show progress of the run.
|
||||
s flag: Show sniff codes in all reports.
|
||||
v flag: Print verbose output.
|
||||
n flag: Do not print warnings.
|
||||
-->
|
||||
<arg value="psvn"/>
|
||||
<arg value="ps"/>
|
||||
|
||||
<!-- Only check the PHP, CSS and SCSS files. JS files are checked separately with JSCS and JSHint. -->
|
||||
<arg name="extensions" value="php,css,scss/css"/>
|
||||
|
|
Reference in New Issue