What it is
Ruff is a Python code checker and formatter written in Rust. It is known for speed and for combining work that used to be split across Flake8, isort, pyupgrade, pydocstyle, and a Black-style formatter.
The repository appeared in 2022 and became part of Astral’s newer Python tooling wave. Its appeal is not only performance, but consolidation: one tool can handle lint rules, automatic fixes, import sorting, and formatting in local development and CI.
What is inside the repository
Inside are the Rust analyzer core, rule implementations, formatter, cache, `pyproject.toml` support, editor integrations, and documentation. Ruff also supports monorepos and cascading configuration, which makes it practical for larger Python codebases.
Minimal configuration
This example shows a basic Ruff setup: choose line length, target Python version, and rule families, then run checks and formatting through one tool.
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
Where it is useful
Ruff is useful in libraries, services, data pipelines, notebooks, and internal Python projects. Its impact is especially visible in large repositories and CI jobs where older linters can take noticeable time.
Strengths and limits
Ruff covers a lot, but rules still need team judgment. Migrating from Flake8, Black, or isort should be done deliberately: compare behavior, lock configuration, and run automatic fixes as a separate change.