Skip to content

Fix false positives for UnusedIssueHandlerSuppression#11212

Merged
orklah merged 1 commit intovimeo:6.xfrom
edsrzf:unused-issue-handler-false-positive
Feb 16, 2025
Merged

Fix false positives for UnusedIssueHandlerSuppression#11212
orklah merged 1 commit intovimeo:6.xfrom
edsrzf:unused-issue-handler-false-positive

Conversation

@edsrzf
Copy link

@edsrzf edsrzf commented Jan 27, 2025

UnusedIssueHandlerSuppression would be emitted for any issue handler rather than just suppressions.

For example, this would trigger it, even if it was used:

<UndefinedClass errorLevel="info" />

This fixes up an if statement so that the issue is only emitted for errorLevel="suppress".

I tried writing a test for this change, but didn't find it very straightforward and settled for not writing one:

  • TestCase doesn't have very good hooks for providing a custom configuration or issue handlers, though it is doable.
  • IssueBuffer::finish doesn't provide a way to inspect the final issues, except by capturing and parsing output (ob_start, etc.)

Happy to receive feedback or advice on testing.

UnusedIssueHandlerSuppression would be emitted for any issue handler
rather than just suppressions.

For example, this would trigger it, even if it was used:

```
<UndefinedClass errorLevel="info" />
```

This fixes up an if statement so that the issue is only emitted for
`errorLevel="suppress"`.
@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Feb 16, 2025
@orklah
Copy link
Collaborator

orklah commented Feb 16, 2025

Thanks!

@orklah orklah merged commit a322e56 into vimeo:6.x Feb 16, 2025
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants