Skip to content

Commit dd81ad8

Browse files
authored
[FEATURE] Add --diff to PHP-CS-Fixer CI dry-run command (MyIntervals#480)
This helps quickly identify the problem. E.g. Before: ```cmd d:\dev\php-css-parser>composer ci:php:fixer > @php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests PHP CS Fixer 3.49.0 (b6dc318) Insomnia by Fabien Potencier, Dariusz Ruminski and contributors. PHP runtime: 7.4.16 Loaded config default from "config/php-cs-fixer.php". ............................................... 1) tests\Value\SizeTest.php (function_declaration, php_unit_fqcn_annotation) Found 1 of 52 files that can be fixed in 1.802 seconds, 20.000 MB memory used ..F.. 52 / 52 (100%) Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error Script @php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests handling the ci:php:fixer event returned with error code 8 ``` Not possible to know what the problem is without further investigation. After: ```cmd d:\dev\php-css-parser>composer ci:php:fixer > @php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests 1) tests\Value\SizeTest.php (php_unit_fqcn_annotation) ---------- begin diff ---------- --- D:\dev\php-css-parser\tests\Value\SizeTest.php +++ D:\dev\php-css-parser\tests\Value\SizeTest.php @@ -8,7 +8,7 @@ use Sabberworm\CSS\Value\Size; /** - * @Covers Size + * @Covers \Size */ final class SizeTest extends TestCase { ----------- end diff ----------- Found 1 of 52 files that can be fixed in 0.029 seconds, 14.000 MB memory used PHP CS Fixer 3.49.0 (b6dc318) Insomnia by Fabien Potencier, Dariusz Ruminski and contributors. PHP runtime: 7.4.16 Loaded config default from "config/php-cs-fixer.php". Using cache file ".php-cs-fixer.cache". SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSFSS 52 / 52 (100%) Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error Script @php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests handling the ci:php:fixer event returned with error code 8 ``` It's now clear what the problem is, and it can be simply resolved. In this case the suggested fix was not correct.
1 parent 870c453 commit dd81ad8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"ci": [
6565
"@ci:static"
6666
],
67-
"ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests",
67+
"ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots --diff bin src tests",
6868
"ci:php:stan": "phpstan --no-progress --configuration=config/phpstan.neon",
6969
"ci:static": [
7070
"@ci:php:fixer",

0 commit comments

Comments
 (0)