astral-sh/ruff
Developer ToolsA fast Python linter and formatter in Rust, with 900+ rules and config-file support for Python projects.
Overview
Ruff is a Python linter and code formatter written in Rust, intended for Python projects that want fast static analysis and automatic formatting behind one common interface. It re-implements rules from Flake8 plugins, isort, Black, pydocstyle, pyupgrade, autoflake and others, and documents drop-in parity with Flake8, isort and Black (3)(19)(20)(21). The project ships over 900 rules, supports pyproject.toml configuration, built-in caching and fix support, and targets modern Python versions including 3.15 compatibility (3).
Ruff is developed by Astral, the company behind uv and ty, and is used in large open-source projects such as Apache Airflow, FastAPI, Transformers, Pandas and SciPy (3)(39)(40)(41). It is a tool for Python developers maintaining codebases, CI pipelines or editor workflows who want linting and formatting with a single dependency.
Quick start
Ruff is published on PyPI. The fastest path is to run it without a global install using uvx, or install it with uv, pip or pipx (3):
uvx ruff@0.17.4 check # lint all files in the current directory
uvx ruff@0.17.4 format # format all files in the current directory
To install it instead:
uv tool install ruff@latest # or: pip install ruff, or pipx install ruff
Standalone installers are also available for macOS/Linux and Windows (3). After installation, run ruff check and ruff format against a directory, a glob of .py files, or a single file:
ruff check path/to/code/
ruff format path/to/code/*.py
A first run reports lint diagnostics and, with --fix, can apply safe corrections. Formatting rewrites files in place. Ruff can also run as a pre-commit hook, a GitHub Action, or in first-party editor integrations for VS Code (3)(24).
Configuration
Ruff reads configuration from pyproject.toml, ruff.toml or .ruff.toml. In pyproject.toml, section headers need the tool.ruff prefix, so [lint] becomes [tool.ruff.lint]. The default configuration assumes Python 3.11, a line length of 88 and Black-style formatting. Enable or disable rules with --select/--ignore on the command line or in the configuration file, and opt into unstable behavior with preview = true or --preview (3). The complete settings and default rule set are documented in the configuration guide.
Constraints
Ruff is installable from PyPI and has standalone installers; the README documents Homebrew, Conda and other package managers, and editor integration for VS Code and other editors (3). The project is MIT-licensed (9). Because Ruff re-implements rules from other tools rather than loading their plugins, Flake8 plugin behavior and rule-code separation may not map one-to-one; the FAQ sections compare its linter, import sorting and formatter behavior to those tools (19)(20)(21). Ruff's rules and preview mode can change between releases, so the README pins installation examples to a specific version.
HotRepo's take
Ruff entered HotRepo's all-language GitHub daily ranking with a recorded best position of 18, and a 2026-11-06 daily snapshot shows 107 stars gained at 50,486 total stars. The project also has a long-running Hacker News thread from January 2025 with 200 points and 150 comments, where commenters discuss the tradeoffs of consolidating Python tooling and re-implementing existing linters in Rust (1). Those discussion opinions are user sentiment, not maintainer claims or measured performance. The package and documentation links are the practical entry points; the README's speed claims are the project's own benchmark framing rather than an independent measurement.
Written by AI from the project's README, updated . The project's own docs are the source of truth.