astral-sh / ruff
git clone https://github.com/astral-sh/ruff.git
0.17.1 · 7d ago
An extremely fast Python linter and code formatter, written in Rust.
+13
stars, 24h · #1,135
+~91
stars, 7 days · #1,435
+~390
stars, 30 days · #1,358
50k
★ total · +0% this week
2.5k
forks · 2.2k open issues
Star history (as recorded here)
LanguageRust
LicenseMIT
Created2022-08-09 (4y ago)
Last pushtoday
Watchers152
OwnerOrganization
GitHub topics
Links
- GitHub: github.com/astral-sh/ruff
- Homepage: https://docs.astral.sh/ruff
- Releases · Issues · Hacker News mentions
README excerpt
# Ruff **Docs** | **Playground** An extremely fast Python linter and code formatter, written in Rust. Linting the CPython codebase from scratch. - ⚡️ 10-100x faster than existing linters (like Flake8) and formatters (like Black) - 🐍 Installable via `pip` - 🛠️ `pyproject.toml` support - 🤝 Python 3.15 compatibility - ⚖️ Drop-in parity with Flake8, isort, and Black - 📦 Built-in caching, to avoid re-analyzing unchanged files - 🔧 Fix support, for automatic error correction (e.g., automatically remove unused imports) - 📏 Over 900 built-in rules, with native re-implementations of popular Flake8 plugins, like flake8-bugbear - ⌨️ First-party editor integrations for VS Code and more - 🌎 Monorepo-friendly, with hierarchical and cascading configuration Ruff aims to be orders of magnitude faster than alternative tools while integrating more functionality behind a single, common interface. Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pydocstyle, pyupgrade, autoflake, and more, all while executing tens or hundreds of times faster than any individual tool. Ruff is actively developed and used in major open-source projects like: - Apache Airflow - Apache Superset - FastAPI - Hugging Face - Pandas - SciPy Ruff is backed by Astral, the creators of uv and ty. Read the launch post, or the original project announcement. ## Testimonials **Sebastián Ramírez**, creator of FastAPI: > Ruff is so fast that sometimes I add an intentional bug in the code just to confirm it's actually > running and checking the code. **Nick Schrock**, founder of Elementl, co-creator of GraphQL: > Why is Ruff a gamechanger? Primarily because it is nearly 1000x faster. Literally. Not a typo. On > our largest module (dagster itself, 250k LOC) pylint takes about 2.5 minutes, parallelized across 4 > cores on my M1. Running ruff against our _entire_ codebase takes .4 seconds. **Bryan Van de Ven**, co-creator of Bokeh, original author of Conda: > Ruff is ~150-200x faster than flake8 on my machine, scanning the whole repo takes ~0.2s instead of > ~20s. This is an enormous quality of life improvement for local dev. It's fast enough that I added > it as an actual commit hook, which is terrific. **Timothy Crosley**, creator of isort: > Just switched my first project to Ruff. Only one downside so far: it's so fast I couldn't believe > it was working till I intentionally introduced some errors. **Tim Abbott**, lead developer of Zulip (also here): > This is just ridiculously fast... `ruff` is amazing. ## Table of Contents For more, see the documentation. 1. Getting Started 1. Configuration 1. Rules 1. Contributing 1. Support 1. Acknowledgements 1. Show Your Support 1. License ## Getting Started For more, see the documentation. ### Installation Ruff is available as `ruff` on PyPI. Invoke Ruff directly with `uvx`: [code] Or install Ruff with `uv` (recommended), `pip`, or `pipx`: [code] Starting with version `0.5.0`, Ruff can be installed with our standalone installers: [c