Skip to content

Schrödinger's comment: it is both commented-out code and a comment that is not code (ERA001 vs RUF100) #25386

@hunterhogan

Description

@hunterhogan

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: ERA001

Found commented-out code (ERA001) [Ln 1, Col 4]
Unused noqa directive (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"

Playground

Version

ruff 0.15.14 (9ad2da3 2026-05-21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleImplementing or modifying a lint rule

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions