Open fredden opened 1 month ago
@fredden Thanks for opening this issue. I agree this is confusing, but I don't think the functionality is incorrectly handled - phpcs-only
is being respected.
I think the issue is more a UI one and that a phpcs
run should not mark an error/warning as fixable (via the X
) when the standard/category/sniff/error code was flagged to be phpcs-only
.
Do you agree ?
Describe the bug
When using the
phpcs-only
orphpcbf-only
attributes within a ruleset, the reports fromphpcs
do not look as expected.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above.phpcs.xml
with the custom ruleset above.phpcs
Time: 18ms; Memory: 6MB
phpcs
andphpcbf
regarding "fixable" error.Expected behaviour
The errors reported by
phpcs
as fixable should be fixed byphpcbf
.Versions (please complete the following information)
master
branch at time of writing)master
branch)Additional context
There are some words describing how the
phpcs-only
andphpcbf-only
attributes should work here: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-Ruleset#selectively-applying-rulesPlease confirm
master
branch of PHP_CodeSniffer.