Runs Flake8 with configuration from pyproject.toml.
Project description
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 is inspired by pyproject-Flake8, though the code was rewritten
from scratch, a test suite was added to make maintenance easier, and
a Flake8's plug-in makes this work with the regular 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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for flake8_pyproject-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cca302fc2cf02cf2988ae070e3d918e9add1502a6cc0ab4d5f5c4fa8fb5801d |
|
MD5 | 5d1e2dc47fadc956bc6c64bc6e1102d4 |
|
BLAKE2b-256 | c6b831783ad096e31acad0d3b3c9477e726d56e636c3c4f906bd91d5486b8ae4 |