Skip to content

no-blanket-suppression

Use named, line-local suppressions instead of blanket, file or range disables.

Why

A blanket suppression hides unrelated errors on its line. A file-level diagnostic downgrade also authorizes future defects outside the reviewed exception. Suppression checks cannot waive themselves.

Fix

Fix the diagnostic or use an exact, line-local rule code with a concrete boundary reason.

Examples

Before — flagged An unscoped ignore hides every diagnostic on the line
app/adapter.py
def value() -> str:
return 1 # pyright: ignore
After — preferred A named diagnostic retains the dependency boundary explanation
app/adapter.py
value = vendor.value # pyright: ignore[reportPrivateUsage] -- the dependency exposes this API only privately