简介
Ruff 是一个用 Rust 编写的超快 Python 代码检查和格式化工具,GitHub 40,000+ stars。单一工具替代 Flake8、Black、isort 等 6 个工具,速度快 10-100 倍。CPython 60 万行代码的完整检查在 0.3 秒内完成。适合需要即时代码质量反馈的 Python 开发者和 AI Agent。
Python linter and formatter written in Rust. 10-100x faster than Flake8 and Black. Replaces Flake8, isort, pyupgrade, and more with a single tool. 40,000+ GitHub stars.
这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。
pip install ruff
ruff check . # 代码检查
ruff check --fix . # 自动修复
ruff format . # 代码格式化Ruff 是一个用 Rust 编写的超快 Python 代码检查和格式化工具,GitHub 40,000+ stars。单一工具替代 Flake8、Black、isort 等 6 个工具,速度快 10-100 倍。CPython 60 万行代码的完整检查在 0.3 秒内完成。适合需要即时代码质量反馈的 Python 开发者和 AI Agent。