-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSR1.Files.SideEffects.FoundWithSymbols not being ignored #3386
Comments
Using the enable/disable method is exactly how this is done, as was included in the 3.2.0 release. The ignore comment just tells PHPCS to ignore any violations on that line, but there aren't any as the sniff adds it to the first line of the file. Replicating the release notes here for clarrity:
|
Ah, I see. Then maybe instead of a bug report, this could be added to documentation somewhere? |
@gsherwood I found this issue while searching to see why My file has this as the first two lines: <?php
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols If I have just I am using version 3.7.1. |
I'm facing same inconsistency as @yakatz. Any movement on that? |
Having this issue as well. I am using version 3.7.1. |
I have opened a PR to hopefully fix this issue. Please have a look at PR #3772. Once that PR has been merged, the below code sample will work: <?php
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
define('MYCONST', 'myval');
// phpcs:enable
$var = 'test'; Testing appreciated. |
FYI: the fix for this issue is included in today's PHP_CodeSniffer 3.8.0 release. As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo). |
Describe the bug
A line that violates the
PSR1.Files.SideEffects.FoundWithSymbols
rule still generates a warning about it even when preceded with// phpcs:ignore
Code sample
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No warnings get generated
Versions (please complete the following information):
Additional context
When the offending line has a space removed between the parameters, thereby violating
Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
, that error does get ignored.If I instead wrap the line in disable/enable, the warning does not get generated
If I disable just that rule, the warning does get generated:
The text was updated successfully, but these errors were encountered: