Unused error code(s) in `# pyrefly: ignore`: unused-ignore
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
There's currently a false positive `bad-specialization` error (https://github.com/facebook/pyrefly/issues/3329#issuecomment-4406375047) in scipy-stubs that's only reported for `numpy>=2.1`. But if I ignore it with `# pyrefly:ignore [bad-specialization]`, then the CI jobs for `numpy<2.1` fail because there it will report an `unused-error` error. (CI logs: https://github.com/scipy/scipy-stubs/actions/runs/25760598778/job/75660439117?pr=1593)
However, when I then add another ignore comment for `unused-error`, Pyrefly will report "Unused error code(s) in `# pyrefly: ignore`: unused-ignore" with `numpy>=2.1`.
I expected that `# pyrefly:ignore[unused-error]` would also apply to itself. But apparently it doesn't.
This means that I have no way to `# pyrefly: ignore` my way of out this situation, without it leading to an error in one of the CI jobs.
Of course I could ignore this false positive in the `pyproject.toml`, but I'd rather not, because that means that any other, possibly true positive, `bad-specialization` errors, will also be ignored.
So what are your thoughts on changing `# pyrefly:ignore[unused-ignore]` so that it'll also apply to itself? And just to be clear: I'm not suggesting that we also exclude this from `--remove-unused-ignore` or something (because that's generally not something you'd run in CI) -- I'm only talking about the error reporting part.
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.