Skip to content

[eradicate] Avoid flagging ruff:ignore comments as code (ERA001)#25537

Merged
ntBre merged 2 commits into
mainfrom
brent/era001-ruff-ignore
Jun 2, 2026
Merged

[eradicate] Avoid flagging ruff:ignore comments as code (ERA001)#25537
ntBre merged 2 commits into
mainfrom
brent/era001-ruff-ignore

Conversation

@ntBre
Copy link
Copy Markdown
Contributor

@ntBre ntBre commented Jun 1, 2026

Summary

Fixes #25535 by treating ruff:ignore and ruff:file-ignore comments in the same way as ruff:enable and ruff:disable comments.

Test Plan

New tests based on the issue

Summary
--

Fixes #25535 by treating `ruff:ignore` comments in the same way as `ruff:enable` and `ruff:disable`
comments.

Test Plan
--

New tests based on the issue
@ntBre ntBre added bug Something isn't working rule Implementing or modifying a lint rule labels Jun 1, 2026
somewhat incredibly, this is also a valid annotation
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Jun 1, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre marked this pull request as ready for review June 1, 2026 21:05
@ntBre
Copy link
Copy Markdown
Contributor Author

ntBre commented Jun 1, 2026

I started wondering if we needed a fix like #25414 for ruff:ignore too, but it actually doesn't reproduce the issue in the playground, which is still on the version before that fix. I can't remember if we did this on purpose, but Codex thinks the new suppression comment parsing doesn't find the ruff:ignore comment here at all, whereas the noqa parsing does find the nested comment. I'll look into that more tomorrow, but I don't think it changes this PR anyway.

@ntBre ntBre merged commit d08cde0 into main Jun 2, 2026
45 checks passed
@ntBre ntBre deleted the brent/era001-ruff-ignore branch June 2, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERA001 conflicts with ruff: ignore supression

2 participants