numeric-ignore (SMP008)

SMP008🛠️ Fix always availableCommentsAll rules

Flags numeric codes in # simplint: ignore[...] comments and replaces them with rule names.

Why is this bad?

The name says what the suppression covers without looking up a code. It also stays readable when the comment is reviewed outside a diagnostic report.

Example

Example: fix

Before

1def initialize(build_data: dict[str, Any]) -> None:  # simplint: ignore[SMP602] # required signature
2    pass

After

1def initialize(build_data: dict[str, Any]) -> None:  # simplint: ignore[imprecise-annotation] # required signature
2    pass

What it does

Active on

  • Known numeric simplint codes in simplint: ignore[...]. The fix replaces only the codes and preserves the other names, spacing, and reason in the comment.

    Example: reported
    1def run(value: Any) -> None:  # simplint: ignore[SMP602, single-letter-name] # external signature
    2    pass
    

Exceptions

  • Rule names already use the preferred form. Unknown codes are left as written.

    Example: not reported
    1def run(value: Any) -> None:  # simplint: ignore[imprecise-annotation] # external signature
    2    pass
    

Fix

The fix is safe and changes only known numeric codes inside the brackets.