flake8-enforce-kwargs
Overview
flake8-enforce-kwargs is a Flake8 plugin designed to enforce the use of keyword arguments in functions and class methods. This plugin helps promote code clarity and readability by encouraging the explicit naming of arguments, making it easier for developers to understand the purpose of each parameter.
Installation
To install the flake8-enforce-kwargs plugin, use the following pip command:
pip install flake8-enforce-kwargs
Usage
After installation, runs automatically when you run the flake8 command. For example:
flake8 your_project_directory
This will check your Python files for functions and class methods that do not use keyword arguments. Any violations of the rule will be reported in the Flake8 output.
Configuration
The plugin can be configured using the Flake8 configuration file (usually setup.cfg or .flake8). Add the following section to enable and configure the flake8-enforce-kwargs plugin:
Additionally, you can customize the behavior of the plugin by adjusting the following optional settings:
- exclude: A list of names or patterns for functions or methods to exclude from the keyword argument check.
Example configuration:
per-file-ignores =
utils.py:EKW002,EKW001
Rules
The flake8-enforce-kwargs plugin enforces the following rules:
All arguments in functions and class methods must use keyword arguments.
Example
pythonCopy code
# This function violates the rule
def add(x, y):
return x + y
# This class method violates the rule
class Calculator:
def multiply(self, a, b):
return a * b
In the example above, the add function and the multiply method violate the keyword argument rule. Running Flake8 with the flake8-enforce-kwargs plugin will report these violations.
License
flake8-enforce-kwargs is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for flake8-enforce-kwargs 0.1.1
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-enforce-kwargs-0.1.1.tar.gz | 4.5 kB | Without provenance | Details for flake8-enforce-kwargs-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_enforce_kwargs-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for flake8_enforce_kwargs-0.1.1-py3-none-any.whl |
Total release size: 9.2 kB
Release files / flake8-enforce-kwargs-0.1.1.tar.gz
| Download URL | flake8-enforce-kwargs-0.1.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86da0506458dab98575e85531fa5cc16b54e87e9cb5c4b83783264bf74c1b71e
|
|
BLAKE2b-256 checksum How to use checksums |
fe798c6217c94447cb55fb85a47b9816b5d0a29abcc0b1099cb17ff9cfb2db17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / flake8_enforce_kwargs-0.1.1-py3-none-any.whl
| Download URL | flake8_enforce_kwargs-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cfe52484db0f415b38d2386a4ac50a66289523828ba02614ea165200e11a14db
|
|
BLAKE2b-256 checksum How to use checksums |
1ab785385660b7e343783e28f758a7d185ed5f24fcdc02a0a39b80ebda29211d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for flake8-enforce-kwargs 0.1.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.