⚡ Lightning Blog: Ruff
Insanely fast. Lint at the speed of Rust.
What Is It?
Ruff is a Python linter and formatter. Written in Rust. Absurdly fast.
Wait, what’s a linter? A linter reads your code and points out problems—bugs, style violations, unused variables. A formatter rewrites your code to follow consistent style rules—spacing, indentation, quotes. Neither changes what your code does.
Ruff does both. It checks your code for issues and fixes most of them automatically. What used to take 30 seconds now takes 300 milliseconds.
Why Does It Exist?
Python had too many tools doing overlapping jobs:
Flake8 for linting
isort for import sorting
Black for formatting
Bandit for security checks
pyupgrade for modernizing syntax
Each one: separate install, separate config, separate run. Your CI pipeline looked like a tool museum.
Ruff replaces all of them. One tool. One config. One command.
Why Is It the Best?
Speed. Ruff is 10-100x faster than the tools it replaces. Not a typo. Run it on a massive codebase—it finishes before you switch windows.
Simplicity. One pyproject.toml section configures everything. No more juggling five config files.
Drop-in replacement. Same rules as Flake8, isort, and others. Migrate without changing your standards.
Auto-fix. Most issues get fixed automatically. Run ruff check --fix and watch problems disappear.
Active development. New rules added constantly. The Python community is betting on Ruff.
Quick Setup
Install
pip install ruffOr with uv (even faster):
uv pip install ruffBasic Usage
# Check for issues
ruff check .
# Check and auto-fix
ruff check --fix .
# Format code (like Black)
ruff format .Configuration
Add to your pyproject.toml:
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
]
ignore = ["E501"] # line too long (let formatter handle it)
[tool.ruff.format]
quote-style = "double"
indent-style = "space"IDE Integration
Zed: Install the Ruff extension. Format on save just works.
VS Code: Install the Ruff extension. Add to settings:
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true
}
}The One Command You Need
ruff check --fix . && ruff format .Lint, fix, format. Done.
Learn More
Ruff: Because life’s too short for slow linters.

