Flake8 Keyword Arguments with Spaces Plugin
The flake8-kwargs-spaces package is a plugin for Flake8 that enforces consistent spacing around the equals sign (=) in function arguments, in both definitions and calls. By integrating this plugin, developers can ensure uniform code formatting and adherence to style guidelines.
Rules
- Multiline: When a keyword argument or default is on its own line (e.g. one argument under the
defor call), use spaces around=→key = 'val'. Violations are reported as EKS100. - Inline: When the argument is on the same line as the
def/call, or when multiple keyword arguments appear on the same line, use no spaces around=→key='val'. Violations are reported as EKS251.
Anti-pattern
def foo(
key='val'
):
return key
foo(
key='val'
)
Best practice
def foo(
key = 'val'
):
return key
foo(
key = 'val'
)
Still anti-pattern
def foo(key = 'val'):
return key
foo(key = 'val')
Still best practice
def foo(key='val'):
return key
foo(key='val')
Installation
From PyPI (once published):
pip install flake8-kwargs-spaces
From source (development or before first publish):
-
Clone the repository and enter it:
git clone git@github.com:sahargavriely/flake8-kwargs-spaces.git cd flake8-kwargs-spaces
-
Run the installation script, then activate the virtual environment:
./scripts/install.sh source venv/bin/activate
-
(Optional) Run the test suite to verify everything works:
pytest tests/ -
The install script builds a wheel under
wheels/. To use the plugin with Flake8, install that wheel in the environment where you want the plugin enforced:pip install ./wheels/flake8_kwargs_spaces-*.whl
-
To avoid conflicts with Flake8’s built-in E251 rule, add a
setup.cfg(or use your existing one) with:[flake8] ignore = E251
-
(Optional) Enable pre-commit hooks:
pre-commit install --hook-type pre-commit --hook-type pre-push pre-commit run --all-files pre-commit run --hook-stage pre-push --all-files
License
MIT. See LICENSE.
Thanks
Metadata
Release files for flake8-kwargs-spaces 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flake8_kwargs_spaces-1.0.5.tar.gz | 4.8 kB | With provenance | Details for flake8_kwargs_spaces-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_kwargs_spaces-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for flake8_kwargs_spaces-1.0.5-py3-none-any.whl |
Total release size: 9.9 kB
Release files / flake8_kwargs_spaces-1.0.5.tar.gz
| Download URL | flake8_kwargs_spaces-1.0.5.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64ceb8934351efc6d3ef47073e37d55f739b14ae19ed62a7c49efce29a9dc24b
|
|
BLAKE2b-256 checksum How to use checksums |
ea92aa21ecbd7bacfdedf4582b46b695115194c843cd0adc5425ed8e7cfda488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logRelease files / flake8_kwargs_spaces-1.0.5-py3-none-any.whl
| Download URL | flake8_kwargs_spaces-1.0.5-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7f8205623a6dbdf8d5aff253924ac6bffdfd0083b934c9346de41a45ecd889a2
|
|
BLAKE2b-256 checksum How to use checksums |
2a4d1a45aca8c549fcb3a9a04569c1d107413b1e58e9804b597c1242a0d2e386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logSecurity for flake8-kwargs-spaces 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for flake8_kwargs_spaces-1.0.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.