Skip to content

Ruff

Ruff is an extremely fast Python linter and formatter that consolidates Flake8, isort, Black, and dozens of other tools into a single binary. The handbook covers initial setup, recommended defaults, security rules, and the architecture that makes Ruff fast.

Get started with Ruff

Use Ruff in your workflow

More Ruff pages

Everything else tagged ruff, grouped by section. Pages featured above are not repeated here.

How To

How to configure Cursor for Ruff

Configure the Ruff extension in Cursor for format-on-save, auto-fix, and import sorting with .vscode/settings.json setup.

How to configure Ruff for Django

Configure Ruff for Django: enable DJ rules to catch null=True on strings and missing __str__, silence auto-generated migrations with per-file ignores.

How to configure Ruff with Claude Code

Wire Ruff into Claude Code via CLAUDE.md rules, PostToolUse hooks, and pre-commit for real-time linting.

How to configure VS Code for a uv project

Configure VS Code for uv projects: auto-detect the .venv interpreter, enable Ruff formatting, and run pytest without extra setup.

How to Disable Ruff Rules for a Block of Code

Suppress Ruff rules across a code block with # ruff: disable and # ruff: enable comments. Cleaner than sprinkling # noqa across every line.

How to Disable the Ruff Formatter for a Block of Code

Skip Ruff formatting with # fmt: off and # fmt: on markers. Useful for hand-aligned code that auto-formatting breaks.

How to Format Python Code Blocks in Markdown Files

Format Python code blocks in Markdown with Ruff 0.16, keep README and docs samples consistent with your source, and stop unwanted rewrites.

How to install OpenAI's Astral plugins for Claude Code

Install OpenAI's Astral plugin for Claude Code. Get skills and a language server for uv, ruff, and ty with live type diagnostics.

How to migrate from Black to Ruff formatter

Replace Black with Ruff's formatter by translating pyproject.toml config, updating pre-commit hooks, and updating CI.

How to replace Black, isort, flake8, and pyupgrade with Ruff

Consolidate a Python project's lint stack onto Ruff by mapping rule prefixes, translating configuration, and updating pre-commit and CI hooks.

How to set up pre-commit hooks for a Python project

Install and configure pre-commit to automatically run linters, formatters, and checks on Git commits. Includes Ruff, mypy, and ty integration.

How to Suppress a Ruff Warning on One Line

Add # noqa: CODE to silence one Ruff rule on one line, and let RUF100 delete the comment once the violation is gone.

From the blog

Posts tagged ruff.

Last updated on