Ruff - Python Linter Written in Rust
Ruff is an extremely fast Python linter written in Rust, 10-100x faster than existing tools.
GitHub
https://github.com/astral-sh/ruff
Key Benefits
1. Extreme Speed
2. All-in-One Tool
Replaces multiple tools:
3. Compatibility
Installation
ash
pip install ruff
or with uv
uv pip install ruff
Usage
ash
Check files
ruff check file.py
Check entire project
ruff check .
Auto-fix
ruff check --fix .
Format code
ruff format file.py
Configuration
Create pyproject.toml:
oml
[tool.ruff]
line-length = 88
target-version = "py38"
[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = ["E501"]
Performance
| Tool | Django codebase check time |
|------|--------------------------|
| Flake8 | 40 seconds |
| Ruff | 0.5 seconds |
| Speedup | 80x |
Why Ruff?
Summary
Ruff is essential for Python development. If you're using Flake8, migrate to Ruff today!
Rating: 猸愨瓙猸愨瓙猸?
Best for: Python projects
Learning curve: 猸愨瓙猸?
💬 评论区 (0)
暂无评论,快来抢沙发吧!