Skip to content

Commit a91945c

Browse files
committed
PHPCS 3.0 will throw exit code 3 for fixable errors
See squizlabs/PHP_CodeSniffer#930
1 parent ef7f9bb commit a91945c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ var phpcsPlugin = function(options) {
202202
return;
203203
}
204204

205-
if (exitCode > 1) {
206-
// On codding style problems Code Sniffer should exists with "1" code.
205+
if (exitCode > 2) {
206+
// On codding style problems Code Sniffer should exists with "1" or "2" code.
207207
// All other non-zero exit codes should be treated as Code Sniffer errors.
208208
var phpcsError = new gutil.PluginError('gulp-phpcs', 'Execution of Code Sniffer Failed');
209209
phpcsError.stdout = output;

test/fixture/error

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
cat > /dev/null
55
# It's just an arbitrary text.
66
echo "This is a test error."
7-
# PHPCS uses exit-codes greater than 1 to report about real errors.
8-
exit 2
7+
# PHPCS uses exit-codes greater than 2 to report about real errors.
8+
exit 3

0 commit comments

Comments
 (0)