flake8-warnings
Python linter that warns you about using deprecated modules, classes, and functions. It provides a CLI as well as flake8 and pylint plugins.
Usage
Installation:
python3 -m pip install flake8-warnings
Now, you can use it in one of the following ways:
- Directly from CLI:
python3 -m flake8_warnings ./my_project/ - As a flake8 plugin. Just run
flake8 ./my_project/, it will automatically detect the plugin. - As a pylint plugin. For pylint, plugins must be explicitly specified:
pylint --load-plugins=flake8_warnings ./my_project/.
How it works
It analyzes all imported modules, classes and functions and detects the following:
- warnings.warn function calls.
- Deprecation decorators like deprecated or deprecation.
- Deprecation messages in docstrings.
- Stdlib modules deprecated by PEP 594.
Error codes
The tool provides a different error code for each warning category:
- 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, soDeprecationWarningwill be reported asWS003. - In pylint, the prefix is
W99, soDeprecationWarningwill be reported asW9903. The "message-symbol" is the warning category. So, if you want to ignore an error aboutDeprecationWarning, add# pylint: disable=DeprecationWarningto 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
- flake8-wranings is licensed under MIT 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.
- astroid is a direct runtime dependency of flake8-warning and it is licensed under LGPL-2.1 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.
Metadata
Release files for flake8-warnings 0.4.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_warnings-0.4.1.tar.gz | 11.9 kB | Without provenance | Details for flake8_warnings-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_warnings-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for flake8_warnings-0.4.1-py3-none-any.whl |
Total release size: 22.9 kB
Release files / flake8_warnings-0.4.1.tar.gz
| Download URL | flake8_warnings-0.4.1.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
443048d7126c16a58d0546b23c5552391fc6e76f1591c60aa6a34fa4335a6878
|
|
BLAKE2b-256 checksum How to use checksums |
f3d35ed2b34c106b6c0ce32028721518292b5ff421f214e1c4224741a452817a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / flake8_warnings-0.4.1-py3-none-any.whl
| Download URL | flake8_warnings-0.4.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe663e4bf3ff0ab7cb8865a60430bfc4e73518c4872ea03d9c2d2edf3a811d52
|
|
BLAKE2b-256 checksum How to use checksums |
331fd2981d5b519ffce005d554dac3f55dd0777029ff3f7478d08f493668023b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Security for flake8-warnings 0.4.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.