Black is an opinionated, deterministic Python code formatter that rewrites files in place with minimal diffs.
- Stars
- 50,197
- Forks
- 2,534
- Open issues
- 2,220
- Last commit
- 6 hours ago
What is it?
Ruff is a Python linter and code formatter written in Rust. It checks code for errors, style issues and outdated patterns, and can automatically fix many of them. It is designed to replace a combination of tools such as Flake8 with its plugins, Black, isort, pydocstyle and pyupgrade, running them through a single command and a shared configuration.
The linter ships with over 900 rules, many of which re-implement popular Flake8 plugins natively in Rust. Rules are enabled through pyproject.toml, ruff.toml or .ruff.toml, and a default rule set works without configuration. Built-in caching skips files that have not changed since the last run.
Ruff is installable via pip, uv, pipx, Homebrew and Conda, and includes editor integrations such as a VS Code extension, pre-commit hooks and a GitHub Action. Its configuration supports hierarchical discovery for monorepos.
Key features
- 01Lints Python code with over 900 rules, many re-implementing Flake8 plugins
- 02Formats code with a Black-compatible formatter
- 03Automatically fixes many detected issues with --fix
- 04Caches results to skip unchanged files
- 05Configurable through pyproject.toml or ruff.toml, with hierarchical config discovery
Use cases
- Replacing Flake8, Black and isort in a Python project with a single tool
- Running lint and format checks as a pre-commit hook or in CI
- Linting a large monorepo quickly with per-directory configuration
- Getting editor feedback and auto-fixes in VS Code and other editors
Quick start
- 1
Install Ruff with uv (recommended)
uv tool install ruff@latest - 2
Install Ruff with pip
pip install ruff - 3
Lint all files in the current directory
ruff check - 4
Format all files in the current directory
ruff format
Topics
FAQ
- What is ruff?
- An extremely fast Python linter and code formatter written in Rust, with over 900 lint rules and Black-compatible formatting. Ruff is a Python linter and code formatter written in Rust. It checks code for errors, style issues and outdated patterns, and can automatically fix many of them. It is designed to replace a combination of tools such as Flake8 with its plugins, Black, isort, pydocstyle and pyupgrade, running them through a single command and a shared configuration.
- Is ruff free to use? What license does it have?
- ruff is open source under the MIT license. Check the license terms before using it in commercial products.
- Is ruff still maintained?
- Actively maintained. The last commit to ruff was on Oct 21, 2026.
- What can I use ruff for?
- Replacing Flake8, Black and isort in a Python project with a single tool Running lint and format checks as a pre-commit hook or in CI Linting a large monorepo quickly with per-directory configuration Getting editor feedback and auto-fixes in VS Code and other editors
- How do I install ruff?
- Install Ruff with uv (recommended): uv tool install ruff@latest Install Ruff with pip: pip install ruff Lint all files in the current directory: ruff check Format all files in the current directory: ruff format
- Where can I get ruff?
- The source code and installation instructions are on GitHub: https://github.com/astral-sh/ruff
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Fast, open-source static analysis CLI that finds bugs and enforces coding standards using code-like patterns instead of regex or ASTs.
Python library for building CLI applications from standard type hints, with automatic help, validation and shell completion.
A retro game engine for Python that lets you make pixel-art games with a fixed palette and low-resolution screen.
A CLI that scores the code quality of a project across 14 languages and produces a report with an overall score and per-file rankings.
A Rust-based static site generator for Markdown documentation, from the team behind Material for MkDocs.