Flake9 is a fork of Flake8 that supports reading configuration from a
pyproject.toml
file, because the authors of Flake8 won't implement it.
In addition, because it's 2020, Python 2.7 support has been dropped.
Here's an example of the pyproject.toml
file:
[tool.flake8] ignore = "E203,E266,H106,H904" max-line-length = 88 max-complexity = 25 hang-closing = true
Flake8 is a wrapper around these tools:
- PyFlakes
- pycodestyle
- Ned Batchelder's McCabe script
Flake8 runs all the tools by launching the single flake8
command.
It displays the warnings in a per-file, merged output.
It also adds a few features:
files that contain this line are skipped:
# flake8: noqa
lines that contain a
# noqa
comment at the end will not issue warnings.you can ignore specific errors on a line with
# noqa: <error>
, e.g.,# noqa: E234
. Multiple codes can be given, separated by comma. Thenoqa
token is case insensitive, the colon before the list of codes is required otherwise the part afternoqa
is ignoredGit and Mercurial hooks
extendable through
flake8.extension
andflake8.formatting
entry points
See our quickstart documentation for how to install and get started with Flake8.
Flake8 maintains an FAQ in its documentation.
If you have questions you'd like to ask the developers, or feedback you'd like to provide, feel free to use the mailing list: code-quality@python.org
We would love to hear from you. Additionally, if you have a feature you'd like to suggest, the mailing list would be the best place for it.
- Flake8 Documentation
- GitLab Project
- All (Open and Closed) Issues
- Code-Quality Archives
- Code of Conduct
- Getting Started Contributing
Flake8 was created by Tarek Ziadé and is currently maintained by Ian Cordasco