diff --git a/index.js b/index.js index ffad0b2..60f4062 100644 --- a/index.js +++ b/index.js @@ -202,8 +202,8 @@ var phpcsPlugin = function(options) { return; } - if (exitCode > 1) { - // On codding style problems Code Sniffer should exists with "1" code. + if (exitCode > 2) { + // On codding style problems Code Sniffer should exists with "1" or "2" code. // All other non-zero exit codes should be treated as Code Sniffer errors. var phpcsError = new gutil.PluginError('gulp-phpcs', 'Execution of Code Sniffer Failed'); phpcsError.stdout = output; @@ -218,7 +218,7 @@ var phpcsPlugin = function(options) { output: '' }; - if (exitCode === 1) { + if ((exitCode === 1) || (exitCode === 2)) { // A codding style problem is found. Attache report to the file to allow // reporters do their job. report.error = true; diff --git a/test/fixture/error b/test/fixture/error index fe471f5..e7f3f6e 100755 --- a/test/fixture/error +++ b/test/fixture/error @@ -4,5 +4,5 @@ cat > /dev/null # It's just an arbitrary text. echo "This is a test error." -# PHPCS uses exit-codes greater than 1 to report about real errors. -exit 2 +# PHPCS uses exit-codes greater than 2 to report about real errors. +exit 3