ScriptsApr 6, 2026·2 min read

Ruff — Ultra-Fast Python Linter & Formatter

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.

SC
Script Depot · 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.

# Install
pip install ruff

# Lint your project
ruff check .

# Auto-fix issues
ruff check --fix .

# Format code (replaces Black)
ruff format .

Add to pyproject.toml:

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

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

Intro

Ruff is an extremely fast Python linter and code formatter written in Rust with 40,000+ GitHub stars. It replaces Flake8, Black, isort, pyupgrade, pydocstyle, and autoflake with a single tool that runs 10-100x faster. A full lint pass on CPython (600K+ lines) completes in under 0.3 seconds. Best for Python developers and AI agents who need instant feedback on code quality. Works with: any Python project, CI/CD pipelines, pre-commit hooks. Setup time: under 1 minute.


What Ruff Replaces

Old Tool Ruff Equivalent Speed Improvement
Flake8 ruff check 25-100x faster
Black ruff format 10-30x faster
isort ruff check --select I 50x faster
pyupgrade ruff check --select UP 100x faster
pydocstyle ruff check --select D 50x faster
autoflake ruff check --select F 80x faster

800+ Lint Rules

Ruff implements rules from 50+ Flake8 plugins:

[tool.ruff.lint]
select = [
    "E",    # pycodestyle errors
    "F",    # pyflakes
    "I",    # isort
    "N",    # pep8-naming
    "UP",   # pyupgrade
    "B",    # bugbear
    "SIM",  # simplify
    "TCH",  # type-checking imports
    "RUF",  # ruff-specific rules
]

Auto-Fix

Most issues can be fixed automatically:

ruff check --fix .
# Fixed 42 issues:
#   12 × F401 (unused imports removed)
#   8  × I001 (imports sorted)
#   6  × UP035 (deprecated typing replaced)
#   ...

Editor Integration

  • VS Code: charliermarsh.ruff extension
  • Neovim: built-in LSP support
  • Pre-commit: ruff-pre-commit hook

CI Configuration

# .github/workflows/lint.yml
- name: Ruff
  run: |
    pip install ruff
    ruff check .
    ruff format --check .

Key Stats

  • 40,000+ GitHub stars
  • 800+ lint rules from 50+ plugins
  • 10-100x faster than alternatives
  • Written in Rust by Astral
  • Used by FastAPI, Pandas, Airflow

FAQ

Q: What is Ruff? A: Ruff is a Python linter and formatter written in Rust that replaces Flake8, Black, isort, and several other tools with a single, 10-100x faster alternative.

Q: Is Ruff free? A: Yes, fully open-source under MIT license.

Q: Is Ruff compatible with Black formatting? A: Yes, ruff format is designed as a drop-in replacement for Black with near-identical output.


🙏

Source & Thanks

Created by Astral. Licensed under MIT.

ruff — ⭐ 40,000+

Thanks to the Astral team for making Python linting instant.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets