-
Notifications
You must be signed in to change notification settings - Fork 51
Feature request: Rule to disallow usage of @phpstan-ignore-*
annotations without error identifier
#245
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
Comments
Just for a reference, the same thing can be achieved with ~30 lines of php code. Example: https://github.com/shipmonk-rnd/phpstan-rules/pull/246/files |
Another approach could be to introduce a config parameter that allows for skipping reading of this token. Then PHPStan acts as if the token is not there at all, and thus the error that it tries to hide still shows up. Might even require less code. |
I like that. Super simple and easy to do. Just one more config param to be passed to |
Not a fan. Less code isn't always better. I'd rather write more code and have the error messages under control. In my opinion We already have this information available in AnalyserResult (getLinesToIgnore, getUnmatchedLineIgnores) so it's something that could be easily achieved with a few lines in AnalyserResultFinalizer. |
Duplicate of phpstan/phpstan#11340 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I built a custom rule in eliashaeussler/phpstan-config#53 that disallows the usage of
@phpstan-ignore-line
and@phpstan-ignore-next-line
annotations without error identifiers.Is this something you'd consider useful as a part of the strict-rules package? If so, I'd be happy to provide a PR. If not, that's fine as well :)
Cheers!
The text was updated successfully, but these errors were encountered: