flake8-enforce-kwargs


Nameflake8-enforce-kwargs JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/fylein/flake8-enforce-kwargs
SummaryFlake8 plugin for enforcing kwargs only argument definition.
upload_time2024-01-10 06:06:19
maintainer
docs_urlNone
authorSiva Narayanan
requires_python
licenseMIT
keywords flake8 kwargs python enforcer arguments parameters
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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:


```[flake8]
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

```# flak8: noqa

# 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fylein/flake8-enforce-kwargs",
    "name": "flake8-enforce-kwargs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "flake8,kwargs,python,enforcer,arguments,parameters",
    "author": "Siva Narayanan",
    "author_email": "siva@fylehq.com",
    "download_url": "https://files.pythonhosted.org/packages/fe/79/8c6217c94447cb55fb85a47b9816b5d0a29abcc0b1099cb17ff9cfb2db17/flake8-enforce-kwargs-0.1.1.tar.gz",
    "platform": null,
    "description": "flake8-enforce-kwargs\n=======================\n\nOverview\n--------\n\n`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.\n\nInstallation\n------------\n\nTo install the `flake8-enforce-kwargs` plugin, use the following pip command:\n\n\n`pip install flake8-enforce-kwargs`\n\nUsage\n-----\n\nAfter installation, runs automatically when you run the flake8 command.\nFor example:\n\n\n```flake8 your_project_directory```\n\nThis 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.\n\nConfiguration\n-------------\n\nThe 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:\n\n\nAdditionally, you can customize the behavior of the plugin by adjusting the following optional settings:\n\n-   exclude: A list of names or patterns for functions or methods to exclude from the keyword argument check.\n\nExample configuration:\n\n\n```[flake8]\nper-file-ignores =\n    utils.py:EKW002,EKW001\n````\nRules\n-----\n\nThe `flake8-enforce-kwargs` plugin enforces the following rules:\n\nAll arguments in functions and class methods must use keyword arguments.\n\nExample\n-------\n\npythonCopy code\n\n```# flak8: noqa\n\n# This function violates the rule\ndef add(x, y):\n    return x + y\n\n# This class method violates the rule\nclass Calculator:\n    def multiply(self, a, b):\n        return a * b\n```\n\nIn 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.\n\nLicense\n-------\n\n`flake8-enforce-kwargs` is licensed under the MIT License - see the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Flake8 plugin for enforcing kwargs only argument definition.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/fylein/flake8-enforce-kwargs"
    },
    "split_keywords": [
        "flake8",
        "kwargs",
        "python",
        "enforcer",
        "arguments",
        "parameters"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ab785385660b7e343783e28f758a7d185ed5f24fcdc02a0a39b80ebda29211d",
                "md5": "efa9c1728c2b7c8c6beb89d022e5f5eb",
                "sha256": "cfe52484db0f415b38d2386a4ac50a66289523828ba02614ea165200e11a14db"
            },
            "downloads": -1,
            "filename": "flake8_enforce_kwargs-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "efa9c1728c2b7c8c6beb89d022e5f5eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4718,
            "upload_time": "2024-01-10T06:06:17",
            "upload_time_iso_8601": "2024-01-10T06:06:17.317639Z",
            "url": "https://files.pythonhosted.org/packages/1a/b7/85385660b7e343783e28f758a7d185ed5f24fcdc02a0a39b80ebda29211d/flake8_enforce_kwargs-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe798c6217c94447cb55fb85a47b9816b5d0a29abcc0b1099cb17ff9cfb2db17",
                "md5": "7e442ef6c3c63e13d8a0c3abf2d3e344",
                "sha256": "86da0506458dab98575e85531fa5cc16b54e87e9cb5c4b83783264bf74c1b71e"
            },
            "downloads": -1,
            "filename": "flake8-enforce-kwargs-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7e442ef6c3c63e13d8a0c3abf2d3e344",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4454,
            "upload_time": "2024-01-10T06:06:19",
            "upload_time_iso_8601": "2024-01-10T06:06:19.625625Z",
            "url": "https://files.pythonhosted.org/packages/fe/79/8c6217c94447cb55fb85a47b9816b5d0a29abcc0b1099cb17ff9cfb2db17/flake8-enforce-kwargs-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-10 06:06:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fylein",
    "github_project": "flake8-enforce-kwargs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "flake8-enforce-kwargs"
}
        
Elapsed time: 0.18449s