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
- List valid rules with
ruff rule --allorruff linterto find the right code. - Replace the unknown selector with the correct prefix or code.
- Re-run ruff to confirm the config parses.
Terminal
ruff linter # list rule prefixes
ruff check . # confirm config parsesMatch 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
ruff check exits 1 on lint violations in CIFix ruff check failing in CI - ruff exits 1 when it finds lint violations, printing "Found N errors" and the…
ruff format --check "would reformat" in CIFix ruff "format --check" failing in CI - ruff lists "Would reformat: <file>" and exits 1 when files are not…
golangci-lint "unknown linters" config error in CIFix golangci-lint "unknown linters: 'X'" in CI - the config enables a linter that the installed golangci-lint…