Role in Ruff's documentation
Ruff's documentation presents the Ruff Linter as "an extremely fast Python linter designed as a drop-in replacement for Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, autoflake, and more". The Ruff landing page lists "drop-in parity with Flake8, isort, and Black" among its features and states that Ruff can be used to replace Flake8 together with those tools. Flake8 is also the reference point for Ruff's performance claims, which describe Ruff as 10-100x faster than existing linters such as Flake8.
- Named as the primary linter Ruff replaces
- Cited alongside isort, pydocstyle, pyupgrade and autoflake
- Used as the benchmark comparison in "linting the CPython codebase from scratch"
- Listed in Astral's benchmark chart with Autoflake, Pyflakes, pycodestyle and Pylint
Stated scope of compatibility
Ruff's FAQ sets out the conditions under which Ruff can act as a drop-in replacement for Flake8: when used without or with a small number of plugins, alongside Black, and on Python 3 code. Under those conditions, the FAQ states that Ruff implements every rule in Flake8. In practice this means all of the F rules, which originate from Pyflakes, along with a subset of the E and W rules, which originate from pycodestyle.
- Drop-in use requires few or no Flake8 plugins
- Assumes the project is formatted with Black
- Applies to Python 3 code
- Covers all F rules and a subset of E and W rules
Flake8-style rule codes
Ruff's linter uses Flake8-style rule codes: an alphabetic prefix followed by digits, such as F401. The prefix indicates the source of the rule — F for Pyflakes, E for pycodestyle, and ANN for flake8-annotations. Rule selectors such as lint.select and lint.ignore accept either a full rule code or any valid prefix, so a configuration can enable a whole Flake8-derived group at once. The documentation suggests starting with a small set of rules and expanding, for example adding the B prefix to enable the flake8-bugbear rules.
- Prefix plus digits format, e.g. F401
- F for Pyflakes, E for pycodestyle, ANN for flake8-annotations
- Selectors accept full codes or prefixes
- ALL selector enables every rule
Re-implemented Flake8 plugins
Ruff's FAQ lists Flake8 plugins and related code quality tools that Ruff re-implements natively, including autoflake, eradicate, flake8-2020, flake8-annotations, flake8-async, flake8-bandit, flake8-blind-except, flake8-boolean-trap, flake8-bugbear, flake8-builtins, flake8-commas, flake8-comprehensions, flake8-copyright, flake8-datetimez, flake8-debugger, flake8-django and flake8-docstrings. The Rules page states that Ruff supports over 900 lint rules, many inspired by tools such as Flake8, isort and pyupgrade, and that every rule is re-implemented in Rust as a first-party feature. Ruff's contributing guide shows Flake8-derived linters, such as flake8-bugbear and flake8-simplify, used as prefixes in changelog entries for rule work.
- Over 900 built-in rules across all sources
- flake8-bugbear among the natively re-implemented plugins
- Every rule re-implemented in Rust as first-party code
- Default rule set includes the F, E, B, UP and RUF categories
Configuration when migrating
Ruff is configured through a pyproject.toml, ruff.toml or .ruff.toml file, with the same configuration strategy whether it is used as a linter, formatter or both. Rule selection for Flake8-derived categories is handled through the lint.select, lint.extend-select and lint.ignore settings. The FAQ notes that the Ruff linter is compatible with Black out of the box as long as the line-length setting is consistent between the two, and that the line-too-long (E501) limit can be overridden for the linter with lint.pycodestyle.max-line-length.
- pyproject.toml, ruff.toml or .ruff.toml configuration files
- lint.select, lint.extend-select and lint.ignore for rule selection
- lint.pycodestyle.max-line-length overrides the E501 limit
- Settings page enumerates all available options
Where this material is published
The statements about Flake8 summarised here appear in the Ruff documentation hosted at docs.astral.sh/ruff, including the Linter, Rules, FAQ, Configuration and Settings pages. Ruff itself is backed by Astral, whose site also describes Ruff as maintaining drop-in compatibility with Flake8, isort and more. Ruff's formatter is documented separately as a drop-in replacement for Black, available via ruff format.
- Documentation: docs.astral.sh/ruff
- FAQ section "How does Ruff's linter compare to Flake8?"
- Astral project pages at astral.sh and astral.sh/ruff
Sources
Last verified 03 Nov 2026. This entry is compiled from the public web pages listed above. Nothing here is stated that those pages do not, and each of them was read on the date shown.