Skip to content

invalid-suppression-comment (RUF103)

Preview (since 0.14.11) · Related issues · View source

Fix is always available.

This rule is unstable and in preview. The --preview flag is required for use.

What it does

Checks for invalid suppression comments

Why is this bad?

Invalid suppression comments are ignored by Ruff, and should either be fixed or removed to avoid confusion.

Example

ruff: disable  # missing codes

Use instead:

# ruff: disable[E501]

Or delete the invalid suppression comment.

References