Skip to content

Commit 03ec064

Browse files
authored
Merge pull request #210 from lcobucci/fix-broken-exit-check
Fix exit code handling
2 parents d0f46c8 + 96275cb commit 03ec064

File tree

3 files changed

+21
-36
lines changed

3 files changed

+21
-36
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test: test-report test-fix
66

77
test-report: vendor
88
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply tests/php-compatibility.patch; fi
9-
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff -u tests/expected_report.txt phpcs.log; if [ $$? -ne 0 ] && [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; exit 1; fi
9+
@vendor/bin/phpcs `find tests/input/* | sort` --report=summary --report-file=phpcs.log; diff -u tests/expected_report.txt phpcs.log; if [ $$? -ne 0 ]; then if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; fi; exit 1; fi
1010
@if [ $(PHP_74_OR_NEWER) -eq 1 ]; then git apply -R tests/php-compatibility.patch; fi
1111

1212
test-fix: vendor

Diff for: tests/expected_report.txt

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,33 @@ FILE ERRORS WARNINGS
66
tests/input/array_indentation.php 10 0
77
tests/input/arrow-functions-format.php 10 0
88
tests/input/assignment-operators.php 4 0
9+
tests/input/binary_operators.php 9 0
910
tests/input/class-references.php 10 0
10-
tests/input/concatenation_spacing.php 24 0
11+
tests/input/concatenation_spacing.php 49 0
1112
tests/input/constants-no-lsb.php 2 0
1213
tests/input/constants-var.php 6 0
13-
tests/input/ControlStructures.php 18 0
14+
tests/input/ControlStructures.php 28 0
1415
tests/input/doc-comment-spacing.php 10 0
1516
tests/input/duplicate-assignment-variable.php 1 0
1617
tests/input/EarlyReturn.php 6 0
17-
tests/input/example-class.php 34 0
18-
tests/input/forbidden-comments.php 8 0
18+
tests/input/example-class.php 36 0
19+
tests/input/forbidden-comments.php 14 0
1920
tests/input/forbidden-functions.php 6 0
2021
tests/input/inline_type_hint_assertions.php 7 0
2122
tests/input/LowCaseTypes.php 2 0
2223
tests/input/namespaces-spacing.php 7 0
2324
tests/input/NamingCamelCase.php 7 0
25+
tests/input/negation-operator.php 2 0
2426
tests/input/new_with_parentheses.php 18 0
2527
tests/input/not_spacing.php 8 0
2628
tests/input/null_coalesce_equal_operator.php 1 0
2729
tests/input/null_coalesce_operator.php 3 0
2830
tests/input/optimized-functions.php 1 0
31+
tests/input/PropertyTypeHintSpacing.php 6 0
2932
tests/input/return_type_on_closures.php 21 0
3033
tests/input/return_type_on_methods.php 17 0
3134
tests/input/semicolon_spacing.php 3 0
35+
tests/input/single-line-array-spacing.php 5 0
3236
tests/input/spread-operator.php 6 0
3337
tests/input/static-closures.php 1 0
3438
tests/input/superfluous-naming.php 11 0
@@ -41,9 +45,9 @@ tests/input/use-ordering.php 1 0
4145
tests/input/useless-semicolon.php 2 0
4246
tests/input/UselessConditions.php 20 0
4347
----------------------------------------------------------------------
44-
A TOTAL OF 310 ERRORS AND 0 WARNINGS WERE FOUND IN 37 FILES
48+
A TOTAL OF 375 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES
4549
----------------------------------------------------------------------
46-
PHPCBF CAN FIX 249 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
50+
PHPCBF CAN FIX 310 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
4751
----------------------------------------------------------------------
4852

4953

Diff for: tests/php-compatibility.patch

+10-29
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
11
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
2-
index 1e809f9..490fcbd 100644
2+
index fd5432c..233e24d 100644
33
--- a/tests/expected_report.txt
44
+++ b/tests/expected_report.txt
5-
@@ -5,44 +5,48 @@ FILE ERRORS WARNINGS
6-
----------------------------------------------------------------------
7-
tests/input/array_indentation.php 10 0
8-
tests/input/arrow-functions-format.php 10 0
9-
tests/input/assignment-operators.php 4 0
10-
+tests/input/binary_operators.php 9 0
11-
tests/input/class-references.php 10 0
12-
-tests/input/concatenation_spacing.php 24 0
13-
+tests/input/concatenation_spacing.php 49 0
14-
tests/input/constants-no-lsb.php 2 0
15-
tests/input/constants-var.php 6 0
16-
-tests/input/ControlStructures.php 18 0
17-
+tests/input/ControlStructures.php 28 0
5+
@@ -15,7 +15,7 @@ tests/input/ControlStructures.php 28 0
186
tests/input/doc-comment-spacing.php 10 0
197
tests/input/duplicate-assignment-variable.php 1 0
208
tests/input/EarlyReturn.php 6 0
21-
-tests/input/example-class.php 34 0
22-
-tests/input/forbidden-comments.php 8 0
9+
-tests/input/example-class.php 36 0
2310
+tests/input/example-class.php 39 0
24-
+tests/input/forbidden-comments.php 14 0
11+
tests/input/forbidden-comments.php 14 0
2512
tests/input/forbidden-functions.php 6 0
2613
tests/input/inline_type_hint_assertions.php 7 0
27-
tests/input/LowCaseTypes.php 2 0
14+
@@ -23,9 +23,9 @@ tests/input/LowCaseTypes.php 2 0
2815
tests/input/namespaces-spacing.php 7 0
2916
tests/input/NamingCamelCase.php 7 0
17+
tests/input/negation-operator.php 2 0
3018
-tests/input/new_with_parentheses.php 18 0
31-
+tests/input/negation-operator.php 2 0
3219
+tests/input/new_with_parentheses.php 19 0
3320
tests/input/not_spacing.php 8 0
3421
-tests/input/null_coalesce_equal_operator.php 1 0
3522
+tests/input/null_coalesce_equal_operator.php 5 0
3623
tests/input/null_coalesce_operator.php 3 0
3724
tests/input/optimized-functions.php 1 0
38-
+tests/input/PropertyTypeHintSpacing.php 6 0
39-
tests/input/return_type_on_closures.php 21 0
40-
tests/input/return_type_on_methods.php 17 0
41-
tests/input/semicolon_spacing.php 3 0
42-
+tests/input/single-line-array-spacing.php 5 0
43-
tests/input/spread-operator.php 6 0
44-
tests/input/static-closures.php 1 0
45-
tests/input/superfluous-naming.php 11 0
25+
tests/input/PropertyTypeHintSpacing.php 6 0
26+
@@ -39,15 +39,15 @@ tests/input/superfluous-naming.php 11 0
4627
tests/input/test-case.php 8 0
4728
tests/input/trailing_comma_on_array.php 1 0
4829
tests/input/traits-uses.php 11 0
@@ -53,10 +34,10 @@ index 1e809f9..490fcbd 100644
5334
tests/input/useless-semicolon.php 2 0
5435
tests/input/UselessConditions.php 20 0
5536
----------------------------------------------------------------------
56-
-A TOTAL OF 310 ERRORS AND 0 WARNINGS WERE FOUND IN 37 FILES
37+
-A TOTAL OF 375 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES
5738
+A TOTAL OF 384 ERRORS AND 0 WARNINGS WERE FOUND IN 41 FILES
5839
----------------------------------------------------------------------
59-
-PHPCBF CAN FIX 249 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
40+
-PHPCBF CAN FIX 310 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
6041
+PHPCBF CAN FIX 319 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
6142
----------------------------------------------------------------------
6243

0 commit comments

Comments
 (0)