Skip to content
Latchkey

ruff "unknown rule selector" config error in CI

ruff rejects a rule code in your select/ignore/extend-select that it does not recognize. It fails to parse the configuration and exits before linting, so no files are checked.

What this error means

ruff fails at startup with a config error like "Failed to parse ... unknown rule selector: XYZ", naming the offending code in pyproject.toml or ruff.toml.

ruff
ruff failed
  Cause: Failed to parse [tool.ruff.lint.select]
  Cause: unknown rule selector: `PT1XX`

Common causes

A misspelled or non-existent rule code

The code in select/ignore does not correspond to any ruff rule, so configuration parsing fails.

A rule code removed or renamed across versions

A ruff upgrade renamed or dropped the code, leaving an unknown selector in the committed config.

How to fix it

Correct the selector to a real code

  1. List valid rules with ruff rule --all or ruff linter to find the right code.
  2. Replace the unknown selector with the correct prefix or code.
  3. Re-run ruff to confirm the config parses.
Terminal
ruff linter        # list rule prefixes
ruff check .       # confirm config parses

Match config to the installed ruff version

Pin ruff and update selectors together when a code is renamed, so config and binary agree.

How to prevent it

  • Validate config after upgrading ruff.
  • Pin the ruff version so selectors stay valid.
  • Use rule prefixes (E, F, PT) deliberately and check the changelog.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →