Find redundant comments in Python code
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flake8-comments-0.1.2.tar.gz
.
File metadata
- Download URL: flake8-comments-0.1.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 780b4fc2820ed4ff8a0a98f3fc993f776ede1aecbe0c6cec64d93814b21c9234 |
|
MD5 | ddf1e7a0db8ba18d742cee96d2b24187 |
|
BLAKE2b-256 | 83383d8706aea09d9bfb22ea3a7f9d04e11090aaa21711051d2f688695ef5892 |
File details
Details for the file flake8_comments-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: flake8_comments-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42250cb4a51dc59e6db25f1291cfb16b78ea233f72dac32a5bc7b09c691235ea |
|
MD5 | 7e70cffc40302c3f018704026c7b2a00 |
|
BLAKE2b-256 | 9b324e4ad1131cf7d2aff04f6dbce80c74a2a39ac290acf4870d343879e5b2bf |