blanket-noqa (PGH004)
Added in v0.0.200 · Related issues · View source
Derived from the pygrep-hooks linter.
Fix is sometimes available.
What it does
Check for noqa annotations that suppress all diagnostics, as opposed to
targeting specific diagnostics.
Why is this bad?
Suppressing all diagnostics can hide issues in the code.
Blanket noqa annotations are also more difficult to interpret and
maintain, as the annotation does not clarify which diagnostics are intended
to be suppressed.
Example
Use instead:
Fix safety
This rule will attempt to fix blanket noqa annotations that appear to
be unintentional. For example, given # noqa F401, the rule will suggest
inserting a colon, as in # noqa: F401.
While modifying noqa comments is generally safe, doing so may introduce
additional diagnostics.