UseLintFixmeCommentRule
To silence a lint warning, use lint-fixme
(when plans to fix the issue later) or lint-ignore
(when the lint warning is not valid) comments.
The comment requires to be in a standalone comment line and follows the format lint-fixme: RULE_NAMES EXTRA_COMMENTS
.
It suppresses the lint warning with the RULE_NAMES in the next line.
RULE_NAMES can be one or more lint rule names separated by comma.
noqa
is deprecated and not supported because explicitly providing lint rule names to be suppressed
in lint-fixme comment is preferred over implicit noqa comments. Implicit noqa suppression comments
sometimes accidentally silence warnings unexpectedly.
Message
noqa is deprecated. Use lint-fixme or lint-ignore instead.
Has Autofix: No
VALID Code Examples
# 1:
# lint-fixme: UseFstringRule
"%s" % "hi"
# 2:
# lint-ignore: UsePlusForStringConcatRule
'ab' 'cd'
INVALID Code Examples
# 1:
fn() # noqa
# 2:
(
1,
2, # noqa
)
# 3:
class C:
# noqa
...