Skip to main content

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:

Metadata

Release files for flake8-comments 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-comments 0.1.1
File Size Uploaded Provenance Actions
flake8-comments-0.1.1.tar.gz 5.3 kB Without provenance Details for flake8-comments-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-comments 0.1.1
File Interpreter ABI Platform Actions
flake8_comments-0.1.1-py3-none-any.whl Python 3 none any Details for flake8_comments-0.1.1-py3-none-any.whl

Total release size: 10.5 kB

Release files / flake8-comments-0.1.1.tar.gz

Download URL flake8-comments-0.1.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6f73ee9788329660932f7a20eca03ec2de077e2c5ab284ec57ab563aa013d8cc
BLAKE2b-256 checksum
How to use checksums
46e01f7a167e1beace51ed9f75f272c1fd20a4498449d0bd73a8600181d1f0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / flake8_comments-0.1.1-py3-none-any.whl

Download URL flake8_comments-0.1.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e3f9365c9fde17efa7baf23cce5f1f6d5c11199e0c37b2fc326b98364847cc9
BLAKE2b-256 checksum
How to use checksums
5b511ed3eb7f767be40bb0cdf7c078128627414ce1be79d2f8d47ed167a94cb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Security for flake8-comments 0.1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page