Skip to content

Ignoring commented-out code with noqa: ERA001 may still trigger RUF100 #6821

@yigor

Description

@yigor

Looks like #1148 wasn't completely fixed:

# commented.py

dictionary = {
    # "key1": 123,  # noqa: ERA001
    # "key2": 456,
}

executing ruff against this file results in the following:

$ ruff commented.py                                                                                                                                                              master
commented.py:2:21: RUF100 [*] Unused `noqa` directive (unused: `ERA001`)
commented.py:3:5: ERA001 [*] Found commented-out code
Found 2 errors.
[*] 2 potentially fixable with the --fix option.

$ ruff --version
ruff 0.0.285

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedReady for implementationbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions