Skip to main content

Flake8-pyproject

Flake8 plug-in loading the configuration from pyproject.toml

Flake8 cannot be configured via pyproject.toml, even though virtually all other Python dev tools have adopted it as the central location for project configuration. The discussion of the original proposal (#234) was closed as "too heated", subsequent feature and pull requests were marked as "spam" (#1332, #1421, #1431, #1447, #1501).

Flake8-pyproject also has bad manners and force-feeds Flake8 the spam it so despises. It registers itself as a Flake8 plug-in to seamlessly load the configuration from pyproject.toml when you run the flake8 command.

Usage

Say your Flake8 configuration in .flake8 (or in tox.ini, or setup.cfg) is this:

[flake8]
ignore = E231, E241
per-file-ignores =
    __init__.py:F401
max-line-length = 88
count = true

Copy that [flake8] section to pyproject.toml, rename it as [tool.flake8], and convert the key–value pairs to the TOML format:

[tool.flake8]
ignore = ['E231', 'E241']
per-file-ignores = [
    '__init__.py:F401',
]
max-line-length = 88
count = true

Then run flake8 in the project root folder, where pyproject.toml is located.

In case your TOML-based configuration is contained in a different folder, or the file has a different name, specify the location with the --toml-config command-line option.

For compatibility with earlier versions of this package, and perhaps extra reliability in terms of possible future breakage of the plug-in hook, the package also provides a flake8p command that could be called alternatively to lint the code.

Metadata

Release files for Flake8-pyproject 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for Flake8-pyproject 1.2.0
File Interpreter ABI Platform
flake8_pyproject-1.2.0-py3-none-any.whl Python 3 none any Details

Release files / flake8_pyproject-1.2.0-py3-none-any.whl

Download URL flake8_pyproject-1.2.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f90aced603bd47b1b60d83fb0b1d127e3d96a53e7a8cc980b4fb96b785be101
BLAKE2b-256 checksum
How to use checksums
fe292945a1ff87de895658096f4654705062415a78e18c524848eac084c8e364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

This release

1.2.0 This release

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.9.1

1 release file

0.9.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page