Skip to main content

Ruff

code quality

Links

Ruff is an extremely fast Python linter and code formatter, written in Rust. It aims to be orders of magnitude faster than alternative tools while integrating more functionality behind a single, common interface. Ruff can be used to replace Flake8 (plus dozens of plugins), Black, isort, pydocstyle, pyupgrade, autoflake, and more, all while executing tens or hundreds of times faster than any individual tool.

oaicite:1


Usage Example

Here’s how to use Ruff to lint and format your Python code:

# Lint all files in the current directory
ruff check .

# Lint all files and apply automatic fixes
ruff check . --fix

Ruff supports over 800 lint rules split across over 50 built-in plugins. By default, Ruff enables Flake8’s F rules, along with a subset of the E rules, omitting any stylistic rules that overlap with the use of a formatter, like ruff format or Black.