CLIActive

Ruff

An extremely fast Python linter and code formatter, written in Rust.

Open source page

Field note

What it does

Ruff is an extremely fast Python linter and code formatter written in Rust. It aims to be orders of magnitude faster than existing tools like Flake8 and Black while integrating more functionality into a single interface. It supports over 900 built-in rules, drop-in parity with Flake8, isort, and Black, and is installable via pip.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

cli

Python / ruff

docker

Not filed / ghcr.io/astral-sh/ruff

Product features

Product features

Code Actions

Provides code actions to fix linting issues.

Configuration preview setting

Set preview = true in configuration file.

Crate versioning

Main crates follow normal policy; others are 0.0.x.

Custom versioning

Uses minor version for breaking changes, patch for bug fixes.

Default configuration

Default rules

Enables rules from F, E, B, UP, and RUF categories by default, omitting stylistic rules overlapping with formatters.

Diagnostics

Surfaces Ruff diagnostics in the editor.

Drop-in Parity with Flake8, isort, and Black

Ruff can replace Flake8, isort, Black, and other tools with drop-in parity.

First-party Editor Integrations

Provides first-party editor integrations for VS Code and more.

Extensive rule set

Supports over 900 lint rules, including categories like F, E, B, UP, RUF, and more.

Fix stabilization

Fixes have applicability levels: display, unsafe, safe.

Fixable Errors

Ruff can automatically fix certain errors like unused imports with --fix.

Format

Format all files in the current directory.

Formatting Support

Formats code using Ruff's built-in formatter.

Line Length Limit

Configurable maximum line length, default 88, adjustable via line-length setting.

Lint

Lint all files in the current directory.

Over 900 Built-in Rules

Includes native re-implementations of popular Flake8 plugins like flake8-bugbear.

--preview flag

Enable preview mode via CLI flag.

Preview mode

Enables new, unstable rules and features.

pyproject.toml Support

Ruff can be configured via pyproject.toml or ruff.toml.

Python formatting

Ruff includes a formatter for Python code.

Python linting

Ruff provides linting for Python code with many rules.

Ruff Language Server

Built-in language server written in Rust, available via `ruff server`.

ruff.toml support

Ruff can be configured via ruff.toml.

Rule preview

Some rules are marked as preview, indicating they are unstable.

Rule stabilization

New rules start in preview and stabilize after at least one minor release.

Separate lint and format preview

Configure preview for linting and formatting independently.