ruff
TLDR
Check current directory
SYNOPSIS
ruff [check] [format] [--fix] [--select rules] [options] [paths]
DESCRIPTION
ruff is an extremely fast Python linter written in Rust. It implements rules from Flake8, isort, pyupgrade, and other tools.
Speed is the primary advantage. Ruff is 10-100x faster than traditional Python linters. This enables real-time feedback and CI integration without delays.
Rule selection controls which checks run. Categories include E (pycodestyle errors), F (Pyflakes), W (warnings), I (isort), UP (pyupgrade), and many more.
The formatter is Black-compatible, providing consistent code style. It integrates with the linter for a unified toolchain.
Configuration in pyproject.toml or ruff.toml customizes behavior. Per-file ignores and extends support complex project needs.
Fix mode modifies files automatically. Unsafe fixes may change behavior and require separate opt-in.
PARAMETERS
check
Run linting.format
Format code.--fix
Auto-fix violations.--unsafe-fixes
Apply unsafe fixes.--select RULES
Rules to enable.--ignore RULES
Rules to ignore.--extend-select RULES
Additional rules.--config FILE
Configuration file.--show-fixes
Show available fixes.--watch
Watch for changes.--output-format FMT
Output format (text, json, etc.).--statistics
Show statistics.--diff
Show diff for fixes.
CAVEATS
Rust-based - requires separate installation from Python. Not all Flake8 plugins are implemented. Rapidly evolving.
HISTORY
Ruff was created by Charlie Marsh in 2022. It achieved immediate popularity due to its speed, replacing multiple Python tools with a single fast alternative.
