Back to Ruff

error

crates/ty_python_semantic/resources/lint_docs/blanket-ignore-comment.md

0.15.21478 B
Original Source

What it does

Checks for ty: ignore comments that don't specify which rules to ignore.

Why is this bad?

A blanket ty: ignore comment suppresses every type-checking diagnostic on the applicable line or file. Specifying rule codes documents which diagnostics are expected and prevents the comment from silencing unrelated errors.

Examples

py
# error
value = unknown  # ty: ignore

Use instead:

py
value = unknown  # ty: ignore[unresolved-reference]