unmatched-suppression-comment (RUF104)
Preview (since 0.14.11) · Related issues · View source
This rule is unstable and in preview. The --preview flag is required for use.
What it does
Checks for unmatched range suppression comments
Why is this bad?
Unmatched range suppression comments can inadvertently suppress violations over larger sections of code than intended, particularly at module scope.
Example
Use instead:
def foo():
# ruff: disable[E501]
REALLY_LONG_VALUES = [...]
# ruff: enable[E501]
print(REALLY_LONG_VALUES)