ScriptsMar 29, 2026·1 min read

Ruff — Ultra-Fast Python Linter & Formatter

Rust-powered Python linter and formatter. 10-100x faster than Flake8 + Black combined. 800+ lint rules, auto-fix, import sorting, and format-on-save.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install ruff

# Lint
ruff check .

# Format
ruff format .

# Fix auto-fixable issues
ruff check --fix .

Intro

Ruff is an extremely fast Python linter and code formatter written in Rust. It replaces Flake8, Black, isort, pycodestyle, pydocstyle, and dozens more tools — in a single binary that runs 10-100x faster.

Best for: Any Python project — linting, formatting, import sorting Works with: VS Code, PyCharm, Neovim, CI/CD, pre-commit hooks


Key Features

  • 800+ rules from Flake8, pycodestyle, pydocstyle, isort, and more
  • Auto-fix for 400+ rule violations
  • Formatter — Black-compatible, drop-in replacement
  • Import sorting — isort-compatible
  • 10-100x faster than existing tools (Rust-powered)
  • Zero config — works out of the box, customizable via pyproject.toml

Configuration

# pyproject.toml
[tool.ruff]
line-length = 88
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "N", "UP"]

🙏

Source & Thanks

Created by Astral. Licensed under MIT. astral-sh/ruff — 35K+ GitHub stars

Related Assets