Skip to content

unused-noqa (RUF100) - false negatives and strange behavior with multiple codes #15682

@DetachHead

Description

@DetachHead

Description

i assume this is an unintentional bug in the logic that allows you to add additional information to noqa comments:

# noqa: D103 this function is self-documenting

but ruff should enforce a space between the code and any additional comments. currently it doesn't seem to do so. it also seems to allow certain completely invalid codes:

# no error even though these aren't valid codes:
def foo(): ... # noqa: D103a
# noqa: Z

interestingly, these are treated as two separate codes:

def foo(): ... # noqa: D103F811

i think it should instead be an error and force the user to separate them with a comma like this:

def foo(): ... # noqa: D103,F811

https://play.ruff.rs/2b3608e9-f97a-459a-960b-f702827ef4e4

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