flake8-warnings


Nameflake8-warnings JSON
Version 0.4.1 PyPI version JSON
download
home_pageNone
SummaryLinter (flake8, pylint, custom CLI) for finding usage of deprecated functions.
upload_time2023-09-28 06:42:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseNone
keywords deprecation flake8 pylint warnings linter flakehell
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # flake8-warnings

Python linter that warns you about using deprecated modules, classes, and functions. It provides a CLI as well as [flake8][flake8] and [pylint][pylint] plugins.

## Usage

Installation:

```bash
python3 -m pip install flake8-warnings
```

Now, you can use it in one of the following ways:

1. Directly from CLI: `python3 -m flake8_warnings ./my_project/`
1. As a [flake8][flake8] plugin. Just run `flake8 ./my_project/`, it will automatically detect the plugin.
1. As a [pylint][pylint] plugin. For pylint, plugins must be explicitly specified: `pylint --load-plugins=flake8_warnings ./my_project/`.

[flake8]: https://flake8.pycqa.org/en/latest/
[pylint]: https://pylint.org/

## How it works

It analyzes all imported modules, classes and functions and detects the following:

1. [warnings.warn](https://docs.python.org/3/library/warnings.html#warnings.warn) function calls.
1. Deprecation decorators like [deprecated](https://github.com/tantale/deprecated) or [deprecation](https://github.com/briancurtin/deprecation).
1. Deprecation messages in docstrings.
1. Stdlib modules deprecated by [PEP 594](https://peps.python.org/pep-0594/).

## Error codes

The tool provides a different error code for each [warning category](https://docs.python.org/3/library/warnings.html#warning-categories):

+ 01: Warning
+ 02: UserWarning
+ 03: DeprecationWarning
+ 04: SyntaxWarning
+ 05: RuntimeWarning
+ 06: FutureWarning
+ 07: PendingDeprecationWarning
+ 08: ImportWarning
+ 09: UnicodeWarning
+ 10: BytesWarning
+ 11: ResourceWarning

This is how they are used in different linters:

+ In flake8, the code prefix is `WS0`, so `DeprecationWarning` will be reported as `WS003`.
+ In pylint, the prefix is `W99`, so `DeprecationWarning` will be reported as `W9903`. The "message-symbol" is the warning category. So, if you want to ignore an error about `DeprecationWarning`, add `# pylint: disable=DeprecationWarning` to this line.
+ If you use CLI, the warning category will be shown you directly, without any obscure codes.

In all cases, the error message is the detected warning message.

## License

1. flake8-wranings is licensed under [MIT License](./LICENSE). On practice, I don't care how you're going to use it. i did the project because it is fun, not because I want to be famous or whatever.
1. [astroid](https://github.com/PyCQA/astroid) is a direct runtime dependency of flake8-warning and it is licensed under [LGPL-2.1 License](https://github.com/PyCQA/astroid/blob/main/LICENSE). It allows commercial and private usage, distribution and whatever, don't confuse it with GPL. However, if your legal department is still nervous, just don't make flake8-warnings a production dependency (why would you?), use it only on dev and test environments.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flake8-warnings",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "deprecation,flake8,pylint,warnings,linter,flakehell",
    "author": null,
    "author_email": "Gram <gram@orsinium.dev>",
    "download_url": "https://files.pythonhosted.org/packages/f3/d3/5ed2b34c106b6c0ce32028721518292b5ff421f214e1c4224741a452817a/flake8_warnings-0.4.1.tar.gz",
    "platform": null,
    "description": "# flake8-warnings\n\nPython linter that warns you about using deprecated modules, classes, and functions. It provides a CLI as well as [flake8][flake8] and [pylint][pylint] plugins.\n\n## Usage\n\nInstallation:\n\n```bash\npython3 -m pip install flake8-warnings\n```\n\nNow, you can use it in one of the following ways:\n\n1. Directly from CLI: `python3 -m flake8_warnings ./my_project/`\n1. As a [flake8][flake8] plugin. Just run `flake8 ./my_project/`, it will automatically detect the plugin.\n1. As a [pylint][pylint] plugin. For pylint, plugins must be explicitly specified: `pylint --load-plugins=flake8_warnings ./my_project/`.\n\n[flake8]: https://flake8.pycqa.org/en/latest/\n[pylint]: https://pylint.org/\n\n## How it works\n\nIt analyzes all imported modules, classes and functions and detects the following:\n\n1. [warnings.warn](https://docs.python.org/3/library/warnings.html#warnings.warn) function calls.\n1. Deprecation decorators like [deprecated](https://github.com/tantale/deprecated) or [deprecation](https://github.com/briancurtin/deprecation).\n1. Deprecation messages in docstrings.\n1. Stdlib modules deprecated by [PEP 594](https://peps.python.org/pep-0594/).\n\n## Error codes\n\nThe tool provides a different error code for each [warning category](https://docs.python.org/3/library/warnings.html#warning-categories):\n\n+ 01: Warning\n+ 02: UserWarning\n+ 03: DeprecationWarning\n+ 04: SyntaxWarning\n+ 05: RuntimeWarning\n+ 06: FutureWarning\n+ 07: PendingDeprecationWarning\n+ 08: ImportWarning\n+ 09: UnicodeWarning\n+ 10: BytesWarning\n+ 11: ResourceWarning\n\nThis is how they are used in different linters:\n\n+ In flake8, the code prefix is `WS0`, so `DeprecationWarning` will be reported as `WS003`.\n+ In pylint, the prefix is `W99`, so `DeprecationWarning` will be reported as `W9903`. The \"message-symbol\" is the warning category. So, if you want to ignore an error about `DeprecationWarning`, add `# pylint: disable=DeprecationWarning` to this line.\n+ If you use CLI, the warning category will be shown you directly, without any obscure codes.\n\nIn all cases, the error message is the detected warning message.\n\n## License\n\n1. flake8-wranings is licensed under [MIT License](./LICENSE). On practice, I don't care how you're going to use it. i did the project because it is fun, not because I want to be famous or whatever.\n1. [astroid](https://github.com/PyCQA/astroid) is a direct runtime dependency of flake8-warning and it is licensed under [LGPL-2.1 License](https://github.com/PyCQA/astroid/blob/main/LICENSE). It allows commercial and private usage, distribution and whatever, don't confuse it with GPL. However, if your legal department is still nervous, just don't make flake8-warnings a production dependency (why would you?), use it only on dev and test environments.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Linter (flake8, pylint, custom CLI) for finding usage of deprecated functions.",
    "version": "0.4.1",
    "project_urls": {
        "Source": "https://github.com/orsinium-labs/flake8-warnings"
    },
    "split_keywords": [
        "deprecation",
        "flake8",
        "pylint",
        "warnings",
        "linter",
        "flakehell"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "331fd2981d5b519ffce005d554dac3f55dd0777029ff3f7478d08f493668023b",
                "md5": "6206589649ebdb6f3cbd2ba694d43f84",
                "sha256": "fe663e4bf3ff0ab7cb8865a60430bfc4e73518c4872ea03d9c2d2edf3a811d52"
            },
            "downloads": -1,
            "filename": "flake8_warnings-0.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6206589649ebdb6f3cbd2ba694d43f84",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10986,
            "upload_time": "2023-09-28T06:42:56",
            "upload_time_iso_8601": "2023-09-28T06:42:56.096932Z",
            "url": "https://files.pythonhosted.org/packages/33/1f/d2981d5b519ffce005d554dac3f55dd0777029ff3f7478d08f493668023b/flake8_warnings-0.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f3d35ed2b34c106b6c0ce32028721518292b5ff421f214e1c4224741a452817a",
                "md5": "fcd1e54519f5b8c2c9a75b5ef03c240b",
                "sha256": "443048d7126c16a58d0546b23c5552391fc6e76f1591c60aa6a34fa4335a6878"
            },
            "downloads": -1,
            "filename": "flake8_warnings-0.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fcd1e54519f5b8c2c9a75b5ef03c240b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11896,
            "upload_time": "2023-09-28T06:42:58",
            "upload_time_iso_8601": "2023-09-28T06:42:58.280881Z",
            "url": "https://files.pythonhosted.org/packages/f3/d3/5ed2b34c106b6c0ce32028721518292b5ff421f214e1c4224741a452817a/flake8_warnings-0.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-28 06:42:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "orsinium-labs",
    "github_project": "flake8-warnings",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flake8-warnings"
}
        
Elapsed time: 0.12027s