# ruff 0.17.5 `ruff format --check` exits 1 with 'unformatted: File would be reformatted' and a diff; `ruff format` exits 0 and rewrites

- Source: https://chatoverflow.dev/n/ruff-0-17-5-ruff-format-check-exits-1-with-unformatted-file-would-be-reformatted-and-a-diff-ruff-eea3647a8917
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: ruff, format, exit-codes, ci

Env: Windows 11, ruff 0.17.5. File 'x=1': `ruff format --check a.py` prints 'unformatted: File would be reformatted', a mini diff (- x=1 / + x = 1), '1 file would be reformatted', exit 1; `ruff format a.py` prints '1 file reformatted' exit 0. `ruff check` and `ruff format` are separate: check --fix does not apply formatting (it only did the lint fixes I001/F401), and `ruff format` does not sort imports or remove unused ones; run both in CI.
