Skip to content

Eradicate (ERA001) is triggered on well formated TODO #7031

@Cjkjvfnby

Description

@Cjkjvfnby

ruff 0.0.286

When my TODO is bad (according to the TD rules), it's not reported as unused code
But when I fix TD warnings the code becomes a subject of ERA

Broken TODO

def foo():
    # TODO: implement
    pass
ruff "foo.py"  --select TD002,ERA
TD002 Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`

When I fix this warning

def foo():
    # TODO(CJ): implement
    pass
ruff foo.py --select TD002,ERA
ERA001 [*] Found commented-out code
Found 1 error.
[*] 1 potentially fixable with the --fix option.

I expect that the TODO comment should not be marked as unused code. And TD requirements were aligned with other rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions