TYPO3 / coding-standards

TYPO3 Coding Standards to be used by TYPO3 projects or extensions
MIT License
52 stars 16 forks source link

Rule "no_trailing_comma_in_singleline_array" is deprecated. #63

Closed lolli42 closed 1 year ago

lolli42 commented 2 years ago

Is there an existing issue for this?

Operating System

linux mint / docker based runTests.sh of core testing-framework, branch 7

Composer version

2.3.5

PHP version

8.1.9

TYPO3 Coding Standards Package version

Latest stable release

Additional version information

lolli@dozer:/var/www/local/coremaster/public/vendor/typo3/testing-framework$ Build/Scripts/runTests.sh -p 8.1 -s cgl -n
Creating network "local_default" with the default driver
PHP 8.1.9 (cli) (built: Aug  4 2022 21:30:30) (NTS)
PHP CS Fixer 3.11.0 Oliva by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.1.9
Loaded config TYPO3 from ".Build/vendor/typo3/coding-standards/templates/extension_php-cs-fixer.dist.php".
Paths from configuration file have been overridden by paths provided as command arguments.
....................................................................                                                                                 68 / 68 (100%)
Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error

Checked all files in 1.821 seconds, 18.000 MB memory used

Detected deprecations in use:
- Rule "no_trailing_comma_in_singleline_array" is deprecated. Use "no_trailing_comma_in_singleline" instead.
Removing local_cgl_run_130888e03d70 ... done
Removing network local_default

Current Behavior

non zero exit code from php-cs-fixer due to deprecated setting

Expected Behavior

exit zero

Steps To Reproduce

No response

Anything else?

No response

lolli42 commented 2 years ago

https://github.com/FriendsOfPHP/PHP-CS-Fixer/commit/3a2a7a86404d5282ac3118548a5ad8e4de594137

lolli42 commented 2 years ago

Update: That's actually "just" a deprecation output that does not trigger non-zero exit. Sorry, misinterpreted my output. As such, this issue is more harmless than first thought.

oliverklee commented 2 years ago

On my setup (using typo3/coding-standards 0.5.5 and friendsofphp/php-cs-fixer 3.11.0), I get the return code 8, which breaks my CI build:

> php-cs-fixer fix --dry-run -v --show-progress=dots
PHP CS Fixer 3.11.0 Oliva by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.1.8
Loaded config TYPO3 from "/var/www/html/.php-cs-fixer.php".
Using cache file ".php-cs-fixer.cache".
SFSS                                                                                                                                                       4 / 4 (100%)
Legend: .-no changes, F-fixed, S-skipped (cached or empty file), I-invalid file syntax (file ignored), E-error
   1) src/extensions/site/Tests/Unit/HelloWorldTest.php (blank_line_after_opening_tag, php_unit_test_case_static_method_calls)

Checked all files in 0.011 seconds, 6.000 MB memory used

Detected deprecations in use:
- Rule "no_trailing_comma_in_singleline_array" is deprecated. Use "no_trailing_comma_in_singleline" instead.
Script php-cs-fixer fix --dry-run -v --show-progress=dots handling the ci:php:fixer event returned with error code 8

I'll downgrade my friendsofphp/php-cs-fixer installation for the time being.

oliverklee commented 2 years ago

Argh … the error return code in my case was a code style warning, not the deprecation. The deprecation indeed does not prevent the 0 return code. So this was a similar false alarm on my side. ;-)

gilbertsoft commented 1 year ago

Fixed with https://github.com/TYPO3/coding-standards/commit/777f4752513692b99c942a50ca7a2320f3458205