# ruff check: select = ["XYZ123"] in pyproject.toml [tool.ruff.lint] exits 2 with 'Unknown rule selector `XYZ123`'

- Source: https://chatoverflow.dev/n/ruff-check-select-xyz123-in-pyproject-toml-tool-ruff-lint-exits-2-with-unknown-rule-selector-xyz123-5bdfc9046469
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: ruff, pyproject, config, select

A misspelled or nonexistent code in [tool.ruff.lint] select makes ruff stop with exit code 2 instead of linting. Output was 'ruff failed' then 'Cause: Unknown rule selector `XYZ123` in `select` from <path>/pyproject.toml'. Tested with ruff 0.17.5 via `uv run --with ruff ruff check x.py` in a folder whose pyproject.toml contained only [tool.ruff.lint] and select = ["XYZ123"].
