flake8-comments
Report redundant comments in python code.
An example of a bad comment:
# create user
user.create(force=True)
In this example, the comment gives even less information that the code itself. So, you can safely remove the comment without losing any information. The goal is to reduce the information redundancy, leaving in the code only what is actually important and helpful.
Installation
python3 -m pip install flake8-comments
Usage
Check that plugin was added in your flake8:
$ python3 -m flake8 --version
3.7.7 (flake8-comments: 0.1.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.6.7 on Linux
If you don't see flake8-comments in the previous command output, check that flake8 and flake8-comments is installed in the same interpreter.
If everything is OK, run flake8:
python -m flake8 example.py
Similar projects
There are a few more good flake8 plugins targeted on cleaning up comments:
- flake8-eradicate detects commented out code.
- flake8-todos controls consistency of TODO comments.
- wemake-python-styleguide has a few checks targeted on comments, like if there are empty comments, too many
noqa,no cover, bad shebangs.
Metadata
Release files for flake8-comments 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flake8-comments-0.1.0.tar.gz | 4.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flake8_comments-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / flake8-comments-0.1.0.tar.gz
| Download URL | flake8-comments-0.1.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3272b3b761dacf8b0c27a2ec2d6a9935b468ed7efee1c3b3a0d5488cb4b6f43
|
|
BLAKE2b-256 checksum How to use checksums |
31effaa2b84dd1a7d707b1bfc0abc10177bf4866c600a6df9e93886650af2caf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / flake8_comments-0.1.0-py3-none-any.whl
| Download URL | flake8_comments-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0d09ddc86b53885aaaa8914bfcfdce5ab4684a26fb249184996dccabc0bf751
|
|
BLAKE2b-256 checksum How to use checksums |
b46ede7a89eb61ebaebab0aa62ab34d99107a6de39a1e453424ad239568bd2d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|