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
How to suppress UnusedPsalmSuppress? #6786
Comments
Hey @donquixote, can you reproduce the issue on https://psalm.dev ? |
I don't think so. I cannot control the php version on psalm.dev. |
To clarify, I am using the cli parameter |
You can, by using |
I found these snippets: https://psalm.dev/r/e200b6c83e<?php
enum E {}
https://psalm.dev/r/e200b6c83e<?php
enum E {}
|
I can't get psalm.dev to give me |
Not all config are available through psalm.dev. This one must be one of them. To suppress UnusedPsalmSuppress, check this part of your config: https://psalm.dev/docs/running_psalm/configuration/#issuehandlers |
I suppose this is to globally suppress UnusedPsalmSuppress? |
https://psalm.dev/docs/running_psalm/dealing_with_code_issues/ You can suppress it for a file or a directory |
I'm closing this because I'm afraid there's no simple better solution here. The suppression module for this specific issue is complex. Issues may come from a lot of places inside Psalm, that's why UnusedPsalmSuppress has to be near the end of analysis and work its way through already emitted issues and check if every suppression has been used. However we're completely out of the analysis at that point and we have no way to access inlined suppression in the code anymore. There may be grounds for improvements if we were to store this suppression from the start inside IssueBuffer and we'll welcome PR on this but we won't work on it. If someone wants to, a good place to start is by looking at IssueBuffer::addUnusedSuppression |
Well, turns out @AndrolGenhald found a solution for this issue here: #7133. It will be available on next release |
I have code that produces an inspection warning in PHP 7.4, but not in PHP 8.
I am using
@psalm-suppress all
to suppress in PHP 7.4, but now I getUnusedPsalmSuppress
in PHP 8.How can I suppress all of it?
The text was updated successfully, but these errors were encountered: