Ruff: check Python changes before applying fixes
A Python linter and formatter with separate checking and rewriting modes. Review diagnostics and formatting differences before accepting automatic changes.
Requirements
A terminal on a supported Windows, macOS or Linux platform, a matching official package, and Python source files. A pip installation requires a supported Python environment; standalone release binaries are also available.
Quick start
The stable release checked on October 29, 2026 is 0.17.3, published October 27. Use the official installation guide or a matching release package. In a supported Python environment, install with python -m pip install ruff==0.17.3. Start with ruff check --no-fix --no-fix-only path/to/code and ruff format --check path/to/code. These modes do not rewrite the checked source files; Ruff may still write its cache. Boloop has not installed or run this version.
A Python linter and formatter with separate checking and rewriting modes. Review diagnostics and formatting differences before accepting automatic changes.
Inspect the change before rewriting it
Ruff combines Python linting and formatting. After an edit, use ruff check --no-fix --no-fix-only to inspect enabled rules and ruff format --check to see whether formatting would change. The formatter check avoids rewriting source files; it is different from ruff format, which formats them in place.
Keep rule choices and fixes reviewable
Enable a deliberate rule set rather than treating every available rule as a project requirement. Review a fix as a code change. In issue 29682, patrick-5546 reports that the PT009 transformation in Ruff 0.17.2 turns regex assertions into re.search calls without adding import re. A contributor acknowledges the report. The issue remained open when checked on October 29, 2026; we have not confirmed a fix in 0.17.3. This concerns a particular transformation, not every lint check.
Add behavioral evidence
A clean lint report does not show that a user flow or recovery path works. Combine it with relevant tests and the AI-generated code acceptance checklist. This recommendation draws on official documentation and the attributed report; Boloop has not benchmarked or run Ruff.
Sources and further reading
- Ruff official projectOfficial documentation · Astral / Ruff contributors
- Ruff installationOfficial documentation · Astral / Ruff contributors
- Formatter check versus in-place formattingOfficial documentation · Astral / Ruff contributors
- Ruff 0.17.3 releaseOfficial documentation · Astral / Ruff contributors
- PT009 missing import re #29682Usage record · patrick-5546; ntBre