Schrödinger's comment: it is both commented-out code and a comment that is not code…
- User
Schrödinger's comment: it is both commented-out code and a comment that is not code (ERA001 vs RUF100)
Summary
First, I'm impressed by the recent reduction of ERA001 false positives. I suspect that ERA001 is an exceptionally difficult rule to implement.
This is the only time I've seen this situation.
# ) # ) # noqa: ERA001Found commented-out code (ERA001) [Ln 1, Col 4] Unused
noqadirective (unused:ERA001) (RUF100) [Ln 2, Col 10]preview = false builtins = [] target-version = "py310" line-length = 88 indent-width = 4 [lint] allowed-confusables = [] dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" extend-select = [] extend-fixable = [] external = [] ignore = [] select = [ "F", "E4", "E7", "E9", "ERA", "RUF" ] [format] indent-style = "space" quote-style = "double"Version
ruff 0.15.14 (9ad2da301 2026-05-21)
Interface
No new interfaces are introduced.
- Assistant
I’ll trace how ERA001 candidates and
noqasuppression interact, add the smallest regression test in an existing suite, then run the focused tests and repository hooks. - Assistant
rgisn’t installed in this checkout, so I’m using the repository’s available search tools and keeping the search scoped to the lint implementation and tests. - Assistant
The inconsistency comes from ERA001’s bracket-only fast path:
# )is recognized, but adding a trailing explanatory/directive comment makes that same fragment fail detection. I’m adjusting that narrow pattern to accept a trailing comment, which lets the existing same-linenoqamachinery suppress ERA001 and count the directive as used. - Assistant
The focused unit and integration tests pass. The integration snapshot shows the intended split: the first unsuppressed
# )still reports ERA001, while the second line’s# noqa: ERA001produces neither ERA001 nor RUF100. I’m reviewing the exact snapshot diff and then running formatting/hooks. - Assistant
The required
uvx prekhook cannot run becauseuvxis not installed in this environment. I’ll run the directly relevant local checks that are available (cargo fmt --checkand the full ERA/RUF100-focused tests), then verify the worktree diff again.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.