-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add false positives warning #7
Comments
Hmm harder than I originally thought because of how this works - it looks for an entry in the baseline when it encounters an error/warning. So when the error/warning is fixed, there is nothing that triggers a search for it in the baseline. So we should keep track of all "matched" baselines, and throw warnings on unmatched ones. |
Hmm and that is exactly the part that gets injected into the phpcs code, no nice clean API for that unfortunately. |
As far as I can see, we can't do this in just this package. We'd need more hacking in phpcs and that's not worth it. We'll just have to wait for squizlabs/PHP_CodeSniffer#3387 to be merged and we can add it there (if it's not part of the eventual code that'll get merged). Closing this. |
Is your feature request related to a problem? Please describe.
After fixing an error for which a baseline entry exists, and running phpcs, nothing happens. There's no difference in output.
Describe the solution you'd like
I would like to receive a warning or error from this tool saying that even though I fixed the phpcs error, the baseline entry is still there in
phpcs.baseline.xml
.Because right now, when somebody re-introduces the original error, it would not trigger a phpcs error/warning because it is still in the baseline, causing a false positive (or an unmatched ignored error).
Describe alternatives you've considered
No alternative
Additional context
PHPStan supports this ootb, it's the
reportUnmatchedIgnoredErrors
parameter, see https://phpstan.org/user-guide/baselineThe text was updated successfully, but these errors were encountered: