Open tdmalone opened 6 years ago
Sorry, in digging into this further I've realised it's not an issue with gulp-phpcs - at least not directly anyway. phpcs itself exits with 1 by default on warnings.
There's a command line flag to change that, if possible it would be fantastic if gulp-phpcs could provide a mechanism to pass that through? Ideally we could manually pass through any args not specifically passed in this function.
(Note that the warning-severity
option determines whether to display warnings or not, but doesn't allow warnings to still be displayed while ignoring the exit code).
Meantime I might also enquire of phpcs whether it's possible to set this option in the phpcs.xml.
EDIT: This can sort of be worked around by running vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
in composer's post-install-cmd
(ideally though it'd be great to be able to pass arbitrary command line options through to phpcs so we can configure this in the gulpfile) - BUT, this will also cause the gulp-phpcs log reporter to not report the warnings visibly at all.
EDIT 2: I imagine this check in gulp-phpcs is the cause of a non-error warning not being output.
I'm running the
log
reporter followed by thefail
reporter, and unexpectedly, the fail reporter is failing on warnings:I'm not sure if this is intended behaviour or not. I'm assuming it's not - but if it is, would it be possible to have an optional flag to only fail on errors?