An extremely fast Python linter and code formatter, written in Rust
open sourceMITfree
Ruff is a linter and code formatter for Python, written in Rust by Astral (the makers of uv and ty), that runs 10 to 100 times faster than the tools it replaces. One command (ruff check, ruff format) stands in for Flake8 and dozens of its plugins, Black, isort, pydocstyle, pyupgrade and autoflake, with drop-in parity for Flake8, isort and Black, over 900 built-in rules and automatic fixes such as removing unused imports. It reads pyproject.toml, caches results for unchanged files, supports hierarchical configuration for monorepos, and includes a language server (ruff server) that powers its VS Code extension and other editor integrations.
Problems it solves
- flake8, black and isort are slow on my large Python codebase
- replace a pile of Python linting and formatting tools with one fast tool
- lint my whole Python repo in a pre-commit hook without waiting
- automatically remove unused imports and upgrade old Python syntax
- a Black-compatible Python code formatter that runs much faster
- sort Python imports without a separate isort step
- configure Python lint rules per directory in a monorepo
- show Python lint errors and quick fixes in my editor as I type
Features
- 10-100x faster than Flake8 and Black
- over 900 built-in lint rules
- drop-in parity with Flake8, isort and Black
- automatic fixes
- built-in caching of unchanged files
- pyproject.toml configuration
- hierarchical configuration for monorepos
- built-in language server (ruff server)
- VS Code extension and other editor integrations
- standalone installers, pip, Homebrew, conda and Docker
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what Ruff does.
- Biome One fast toolchain that formats and lints JavaScript, TypeScript, JSON, CSS, HTML, GraphQL, YAML and Markdown.
- ESLint Find and fix problems in your JavaScript code.
- ShellCheck A shell script static analysis tool
- actionlint Static checker for GitHub Actions workflow files
- typos Source code spell checker
