Skip to content
FossShelf
Home / Categories / For Engineers

Ruff

Python linter and formatter, 10-100x faster than Flake8

Replaces —

51.26K starsMITreviewed 7 Nov 2026last commit 15 Nov 2026
Screenshot of Ruff

Who it's for

Python teams with slow CI lint pipelines

Teams where lint adds 20+ seconds to CI runs, or where developers skip pre-commit hooks because they are too slow. Ruff drops most lint steps from multiple seconds to under one second, making it practical to run as a blocking commit hook and in every CI stage.

Your CI lint step already completes in under 2 seconds with your current tools. At that speed, the migration effort likely exceeds the time saved.

Developers consolidating multiple Python tooling configs

Individual developers or small teams maintaining separate Flake8 configs, Black configs, and isort settings who want one pyproject.toml block. Ruff consolidates all three under a single [tool.ruff] section with one version pin.

Your team depends on Flake8 plugins with no Ruff equivalent. Check the Ruff rules list first to verify your required plugin has a native re-implementation before committing to migration.

Teams running Python in monorepos

Projects with multiple Python packages under one repo, each needing different rule sets or exclusions. Ruff's hierarchical config reads per-directory overrides cascading from the root, so each package can extend or override the top-level config without separate tool installs.

Your monorepo also includes non-Python codebases where you need a unified linting story. Ruff covers only Python files, so you will still need separate tools for other languages.

Open source Python projects enforcing style in CI

Projects like FastAPI, Pandas, and SciPy use Ruff as their lint gate in CI. The ruff-action GitHub Action adds it in two lines of YAML and produces inline annotations on pull requests, making it easy for contributors to find and fix violations before review.

Your contributors are unfamiliar with linting and you need a hosted dashboard for code quality trends. Ruff produces CLI output only; it has no built-in reporting UI.

The problem

Python code quality typically requires several tools running in sequence: Flake8 for violations, Black for formatting, isort for import sorting, and additional plugins for coverage like pydocstyle or pyupgrade. Each tool has its own config file, its own pip dependency, and its own execution time. On a medium-sized codebase, that chain can add 20-30 seconds to every CI run, long enough that pre-commit hooks become a friction point developers skip. Maintaining separate plugin lists compounds the problem. Flake8 alone has dozens of plugins, each needing its own version pin. When one plugin breaks on a new Python version, the whole lint step fails. Teams frequently disable lint locally to avoid the wait, then discover violations only in CI where the feedback loop is longest.

How it works

Rust-powered execution, 10-100x faster than existing tools

Ruff is written in Rust rather than Python, letting it parallelize file analysis natively without interpreter startup cost. Users report scanning 250,000-line codebases in 0.4 seconds, versus 2.5 minutes with pylint on the same hardware. The official benchmark shows it linting the CPython codebase from scratch faster than any existing Python linter.

Replaces Flake8, Black, isort, and more in one install

A single Ruff install covers linting (Flake8 and over 900 rules), formatting (Black-compatible output), import sorting (isort), unused import removal (autoflake), and docstring style (pydocstyle), with no separate plugin installs. One command, one config file, one version pin in requirements.

900+ built-in rules with auto-fix support

Ruff re-implements rules from flake8-bugbear, flake8-comprehensions, pyupgrade, pandas-vet, and 40+ other Flake8 plugins natively in Rust. Many rules support --fix, so running ruff check --fix removes unused imports, rewrites deprecated syntax, and cleans up formatting in one pass without manual review.

Drop-in parity with Flake8 and Black

Ruff's linter matches Flake8's rule surface at the same error codes (F401, E501, etc.), so existing noqa comments and tool-specific configs migrate without rewriting. Its formatter follows Black's output style, so projects already on Black see no diff after switching.

Pre-commit hook and GitHub Action integrations

The ruff-pre-commit package adds Ruff as a pre-commit hook in one config block. The ruff-action GitHub Action runs it in CI with zero additional setup. First-party VS Code extension and other editor integrations are maintained by Astral, the company behind Ruff.

Monorepo-friendly hierarchical configuration

Ruff reads config from pyproject.toml, ruff.toml, or .ruff.toml and supports per-directory overrides. In a monorepo, each package can extend or override the top-level config without separate installs. Rule selection, file exclusions, and per-file ignores cascade from the repo root down.

Features

  • Rust-powered execution, 10-100x faster than existing tools
  • Replaces Flake8, Black, isort, and more in one install
  • 900+ built-in rules with auto-fix support
  • Drop-in parity with Flake8 and Black
  • Pre-commit hook and GitHub Action integrations
  • Monorepo-friendly hierarchical configuration

How to install

Install Ruff via pip, uv, or the standalone shell installer.

pip install ruff

uv tool install ruff@latest

curl -LsSf https://astral.sh/ruff/install.sh | sh

Recommended for this setup

Strengths

  • MIT license with no cloud dependency: Ruff is MIT licensed and runs entirely on the developer's machine or CI runner. The binary requires no account setup, cloud connection, or API key. Unlike paid code quality platforms, the full analysis happens locally at no cost, and you retain full control over what code is analyzed and where.
  • 50,000+ stars and production adoption at scale: With over 50,000 GitHub stars and adoption in Apache Airflow, FastAPI, Pandas, Hugging Face, and SciPy, Ruff has validation at codebases of several hundred thousand lines. It is backed by Astral, the company behind uv, and was last updated on November 7, 2026.
  • One config section replaces three separate tool configs: Moving from Flake8, Black, and isort means one pyproject.toml [tool.ruff] section instead of three separate config blocks. This eliminates the version-pinning surface area that comes with separate plugin installs, since Ruff bundles all rules in one binary.

Trade-offs

  • Formatter offers limited style customization by design: Ruff's formatter follows Black's opinionated style: minimal configuration, automatic line length at 88 characters, and double quotes. Teams that want granular style control will find the options constrained by design. This is a deliberate trade for consistency, mirroring Black's philosophy.
  • Python-only; other languages need separate linters: Ruff analyzes Python files only. Monorepos with JavaScript, Go, or Rust code still need separate linters for those languages. Teams looking for a unified multi-language static analysis tool will need to combine Ruff with other tools rather than using it as a single-tool quality gate.
  • 1,733 open issues including edge-case rule parity gaps: With 1,733 open issues, Ruff's rule coverage has known gaps versus the full Flake8 plugin ecosystem. Teams using Flake8 plugins not on Ruff's supported list should check for compatibility before switching. The most popular plugins are covered, but the ecosystem has hundreds of community plugins.

Tech stack

Languages
Rust, Python, TypeScript, Shell, HTML, CSS, Jinja, Dockerfile, RenderScript
Frameworks
React
Databases
—
Tooling
—

FAQ

How does Ruff compare to Flake8?

Ruff replaces Flake8 and uses the same error codes (F401, E501, etc.), so existing noqa comments and configuration migrate without rewriting. The key difference is speed: Ruff runs 10-100x faster on typical codebases, and it requires zero plugin installs since it re-implements over 900 rules natively in Rust. Most common Flake8 plugins have native equivalents in Ruff.

Can Ruff fully replace Black for formatting?

Yes, for most codebases. Ruff's formatter follows Black's output style, and the README documents drop-in parity with Black. Projects already using Black will see no meaningful diff after switching to ruff format, and existing pyproject.toml [tool.black] settings migrate to [tool.ruff.format].

Is Ruff free to use? What is the license?

Ruff is MIT licensed. It is free to use for any purpose including commercial projects, with no seat fees, no cloud account, and no data uploaded to any service. Install it with pip install ruff and run it locally or in CI with no additional registration.

Does Ruff support pre-commit hooks?

Yes. The ruff-pre-commit package adds Ruff as a pre-commit hook. Add the ruff-check hook to run the linter and ruff-format to run the formatter in .pre-commit-config.yaml. The hook uses the same pyproject.toml settings Ruff reads everywhere else, so no separate config is needed.

How do I migrate from Flake8, Black, and isort to Ruff?

Remove flake8, black, and isort from your requirements and add ruff. Run ruff check --select ALL --diff to preview what would change before applying any fixes. Existing noqa comments are respected. The ruff format command replaces black, and ruff check with I-prefixed rules handles import sorting. The Ruff documentation at docs.astral.sh/ruff covers the full plugin migration mapping.

Similar tools

More in Engineers