Skip to content

Expected for noqa to be ignored for multi-line string variable? #4484

@fennerm

Description

@fennerm

(ruff=v0.0.267).

Based on the docs we can add a noqa annotation to a multi-line string as follows:

"""
Some long
string.
"""  # noqa

I would assume this should also be true if the string is a variable, but the noqa annotation seems to be ignored in that case.

Minimal example:

weirdly_Cased: str = """
Some long
string.
"""  # noqa: N816

Ruff outputs:

N816 Variable `weirdly_Cased` in global scope should not be mixedCase
RUF100 [*] Unused `noqa` directive (unused: `N816`)

Possible that this case is deliberately not supported yet but figured I'd flag it. Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsuppressionRelated to supression of violations e.g. noqa

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions