Ruff vs Flake8: Which Python Linter for CI?
Ruff is a Rust-based linter that runs vastly faster than Flake8 and folds in many plugins’ rules.
Flake8 is a long-standing Python linter that wraps pyflakes, pycodestyle, and plugins. Ruff (from Astral) is a Rust-based linter that reimplements a large set of Flake8/plugin rules and runs orders of magnitude faster, often replacing several tools at once.
| Flake8 | Ruff | |
|---|---|---|
| Implementation | Python | Rust |
| Speed | Slower | Extremely fast |
| Rule coverage | Core + plugins | Reimplements many plugins’ rules |
| Autofix | No | Yes (many rules) |
| Consolidation | Multiple tools/plugins | One tool for many checks |
In CI
Ruff typically lints a large Python codebase in a fraction of a second where Flake8 takes much longer, and it can replace Flake8 plus several plugins (isort, pyupgrade-style rules, and more) with one fast binary. It also autofixes many issues. Flake8 remains familiar and stable; if you rely on a niche Flake8 plugin Ruff has not yet ported, keep that check.
Migration effort
Map your enabled Flake8 plugins to Ruff rule sets, run Ruff with --fix in one commit, then enforce in CI. Most common Flake8/plugin rules have Ruff equivalents; verify any specialized plugins you depend on.
The verdict
Want very fast linting that consolidates several tools and autofixes: Ruff. Depend on a niche Flake8 plugin Ruff lacks: keep that check (or run both). Most teams move the bulk of linting to Ruff.