Skip to content

renamed-rule (RUF202)

Preview (since 0.17.5) · Category: suspicious · 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 Ruff configuration files for redirected rule names, codes, and prefixes.

Why is this bad?

A redirected selector still selects the same rules as its replacement. Using the current selector makes it easier to find those rules in Ruff's documentation.

Example

[tool.ruff.lint]
select = ["TCH"]
ignore = ["TCH002"]

Use instead:

[tool.ruff.lint]
select = ["TC"]
ignore = ["TC002"]