ruff check exits 1 on lint violations in CI
ruff exits 1 when it reports any lint violation. The summary line "Found N errors." and the rule codes (like F401, E501) tell you exactly what to fix; many are auto-fixable.
What this error means
The lint step lists violations as file:line:col: CODE message, ends with "Found N errors." and a "[*] N fixable with the --fix option" hint, and exits 1.
ruff
app/main.py:1:8: F401 [*] `os` imported but unused
app/main.py:14:5: E731 Do not assign a lambda expression, use a def
Found 2 errors.
[*] 1 fixable with the `--fix` option.Common causes
Real rule violations in the selected rule set
ruff found problems under the rules you enabled (select), so it exits 1 and reports each with its code.
A wider rule set surfaced new findings
Enabling more rules or upgrading ruff (which ships new checks) can add violations that were not flagged before.
How to fix it
Auto-fix what you can, then fix the rest
- Run
ruff check --fixto apply the fixable findings. - Resolve the remaining violations by hand using the rule codes.
- Re-run
ruff checkand confirm it exits 0.
Terminal
ruff check --fix .
ruff check . # confirm 0 errorsSilence a specific finding deliberately
Use a # noqa: CODE on a line or per-file-ignores in config rather than disabling ruff in CI.
pyproject.toml
# pyproject.toml
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]How to prevent it
- Run
ruff checklocally or in pre-commit before pushing. - Pin the ruff version so new rules do not appear unexpectedly.
- Adopt new rule sets in a dedicated change with the fixes.
Related guides
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…
ruff "unknown rule selector" config error in CIFix ruff "unknown rule selector" / config parse error in CI - a code in select or ignore does not match any r…
ESLint "Command failed with exit code 1" on lint errors in CIFix ESLint exiting with code 1 in CI - ESLint returns a non-zero exit when any error-level rule is violated,…