Open-source project
PyCQA/flake8 avatar
PyCQA/flake8

flake8: three linters, one command, and a colon that matters in noqa

flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.

3,837 stars398 forksPythonNOASSERTION

At a glance

What is it?
The PyCQA wrapper that runs PyFlakes, pycodestyle, and McCabe under a single `flake8` invocation with merged per-file output. It has no releases of its own, and its whole configuration surface lives outside this repository.
Who is it for?
Take flake8 if you want style and lint checking from one command with the pycodestyle and PyFlakes semantics your team already knows, and if you rely on `noqa` selectively rather than globally. Check three things first.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 11 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • PyCQA/flake83,837 ★ · +13
Star history
Repository2026-09-242026-11-15
PyCQA/flake83.8k3.8k

13 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The colon after noqa is required or the codes are discarded

The suppression mechanism has one rule that is easy to get wrong and produces silent failures when broken. A line ending in a `# noqa` comment issues no warnings, full stop. To ignore specific errors on that line you write `# noqa: <error>`, and the example given is `# noqa: E234`. Multiple codes are separated by a comma. The `noqa` token itself is case insensitive, so casing is not the problem. The part that bites is the colon: it is required before the list of codes, and without it the text after `noqa` is ignored entirely. So `# noqa E234` suppresses nothing beyond the blanket case, and a reader auditing the file sees what looks like a targeted exemption that is actually a whole-line disable. Two further scopes exist above the line: a file containing the line `# flake8: noqa` is skipped in its entirety, which is the blunt instrument to reach for last.

Three tools, one process, merged output

Flake8 is a wrapper, and naming its parts is the fastest way to understand why its output looks the way it does. It runs PyFlakes, pycodestyle, and Ned Batchelder's McCabe script. PyFlakes is what finds undefined names, unused imports, and the class of problems that are errors rather than style. pycodestyle is the style checker, which is where the E-series codes such as the E234 in the suppression example come from. McCabe is the complexity checker, which is where the C-series codes come from and what makes cyclomatic complexity reportable through the same interface as a stray blank line. All three run from a single `flake8` command rather than three separate invocations, and the warnings are displayed in a per-file merged output. That merge is the whole value proposition for anyone who used to run three tools and reconcile three reports, and it is also the reason switching to a single-tool alternative is a semantic change rather than a speed change.

Plugins attach at two entry points, and one ships as an example

Extension happens through Python packaging entry points rather than by subclassing something at runtime, and there are two of them by design. `flake8.extension` is where a plugin contributes a check, and `flake8.formatting` is where a plugin changes how output is rendered. Splitting them means a plugin can add a new rule without taking over presentation, and a plugin can restyle output without reimplementing checks. The project documents the mechanism by shipping an `example-plugin/` directory at the repository root, which is the reference anyone writing their own check should read first. The README frames extensibility in one line, extendable through those two entry points, and does not document the plugin API further, which means the example directory and the documentation site carry that burden. For a team with a house rule, this is the supported way to add it rather than patching the source.

No releases, and configuration lives in setup.cfg

Two practical facts about obtaining and configuring this tool. First, there are no GitHub releases in this repository, so there is no release asset and no tag to pin; the README sends you to the quickstart documentation for how to install and get started, which is where the install command lives rather than on this page. Second, the packaging is old-style in a way that is still visible in the tree. There is a `setup.py` whose entire body is a docstring, three imports, a `sys.path` insertion pointing at `src`, and a call to `setuptools.setup()`, with all real metadata living in `setup.cfg` beside it. That structure is what a src-layout package looks like when metadata is declared rather than generated, and it is the reason the path insertion exists. Alongside it sit `tox.ini` and `pytest.ini` for running the test suite across environments, a `dev-requirements.txt`, and a `.pre-commit-config.yaml`, which is the file that matters if you plan to run this as a commit hook rather than by hand.

Git and Mercurial hooks are the only VCS support named

Of the wrapper's added features, version control integration is listed as Git and Mercurial hooks. That is the whole of it: two systems, named without further explanation, and nothing in this page about how they behave, whether they are installed by the package, or how to configure which files they examine. It is also the feature most likely to have aged in a particular way, since the Python packaging ecosystem moved toward tools like pre-commit years ago, and this repository itself carries a `.pre-commit-config.yaml` and a `.pre-commit-hooks.yaml` at the root, which is the project consuming that ecosystem rather than providing it. The badges at the top of the README tell you the same story from the other side: there is a build status badge for the main workflow and a separate pre-commit.ci status badge, so the project's own code is checked on both paths while it still offers the older hooks to its users.

Two maintainers, one original author, and a mailing list

The maintenance section is three names and no version policy. Flake8 was created by Tarek Ziadé and is currently maintained by anthony sottile and Ian Cordasco, with links to the former's GitHub sponsorship page and the latter's personal site. There is no roadmap, no support statement, and no release cadence in this page, and with no GitHub releases attached, the practical way to judge current activity is the branch itself, whose last push was 2026-09-29. Questions and feedback go to a mailing list at [email protected], and the page is explicit that this is also the place to suggest features, which is a useful signal about how design decisions get made in a project of this size. The community surface is broader than that one list: there is a Discord badge, a contributing guide, a code of conduct, a `CONTRIBUTORS.txt`, and a link to the Code-Quality archives on the Python mailing list server.

The licence is unasserted in metadata while a LICENSE file exists

There is a small inconsistency worth flagging before you rely on it. The project's licence field is recorded as unasserted, which means the metadata carries no usable identifier rather than that the project has no licence. The repository tree does contain a `LICENSE` file at the root, alongside `CONTRIBUTING.rst` and `CONTRIBUTORS.txt`, so the terms are present in the repository even though the machine-readable field does not name them. If you need the licence identifier for a compliance check or a dependency audit, read the file. That is the same pattern the quickstart documentation has here generally: this README is deliberately short, pointing at a documentation site for installation, for the FAQ, for the code of conduct, and for the contribution process, and the tree is where the mechanism lives. The repository also carries a `.bandit.yml` for the security linter and a `.pylintrc`, which is worth noting as a small irony: the project that replaced pylint for most users still ships a pylint configuration for its own source.

Editorial conclusion

Take flake8 if you want style and lint checking from one command with the pycodestyle and PyFlakes semantics your team already knows, and if you rely on `noqa` selectively rather than globally. Check three things first. The colon in `# noqa: E234` is required, and without it the part after `noqa` is ignored, so a suppression you believed was scoped is in fact blanket. The repository publishes no GitHub releases, so there is no tag to pin and installation has to come from the quickstart documentation rather than a release asset. And the project's licence is recorded as unasserted here even though a `LICENSE` file exists at the root, so read that file rather than trusting the metadata.

Frequently asked questions

What is Flake8 used for?

It checks the style and quality of Python code by running PyFlakes, pycodestyle, and Ned Batchelder's McCabe script under a single flake8 command, displaying warnings in a per-file merged output.

How do I ignore a specific error in flake8?

Add `# noqa: <error>` at the end of the line, for example `# noqa: E234`, with multiple codes separated by a comma. The colon is required or the part after noqa is ignored, the noqa token itself is case insensitive, and a line with a bare `# noqa` suppresses everything.

How do I write a plugin for flake8?

Register it through Python packaging entry points. `flake8.extension` is where a plugin contributes a check and `flake8.formatting` is where it changes output rendering. The repository ships an example-plugin directory that serves as the reference implementation.

Does flake8 fix code automatically?

Nothing on this page describes an autofix. The documented features are merging the three tools' output, file-level and line-level noqa suppression, Git and Mercurial hooks, and the two plugin entry points. Any reformatting is left to other tools.

How do I install flake8?

The README does not carry an install command and points to the quickstart documentation for how to install and get started. The repository publishes no GitHub releases, so there is no release asset to download and nothing to pin.

Official sources

  1. Issues
  2. Project website
  3. PyCQA/flake8 on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/pycqa-flake8.svg)](https://hysenlabs.com/projects/pycqa-flake8)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/pycqa-flake8.svg)](https://hysenlabs.com/projects/pycqa-flake8)

Was this useful?