Ruff#
Ruffは、Rustで記述された、非常に高速なPythonリンタとコードフォーマッタです。
Linting the CPython codebase from scratch.
- ⚡️ 既存のリンタ(Flake8など)やフォーマッタ(Blackなど)よりも10~100倍高速
- 🐍
pip
を使用してインストール可能 - 🛠️ http://
pyproject.toml
のサポート - 🤝 Python 3.13との互換性
- ⚖️ Flake8、isort、およびBlackとの互換性
- 📦 変更されていないファイルの再解析を回避するための組み込みキャッシュ
- 🔧 自動エラー修正のための修正サポート(未使用のインポートを自動的に削除するなど)
- 📏 Flake8-bugbearのような人気のあるFlake8プラグインのネイティブな再実装を使用して、800 built-in rules
- ⌨️ VS Codeとmoreのためのファーストパーティeditor integrations
- 🌎 Monorepoフレンドリーなhierarchical and cascading configuration
Ruffは、単一の共通インターフェースの背後により多くの機能を統合しながら、他のツールよりも桁違いに高速になることを目指しています。
Ruffは、Flake8(および数十のプラグイン)、Black、isort,pydocstyle,pyupgrade,autoflakeなどを置き換えるために使用でき、個々のツールよりも数十倍から数百倍の速度で実行できます。
Ruffは非常に活発に開発されており、次のような主要なオープンソースプロジェクトで使用されています。:
RuffはAstralによって支援されています。launch post、またはオリジナルの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:
This is just ridiculously fast...
ruff
is amazing.