Skip to main content

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-comments-0.1.2.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

flake8_comments-0.1.2-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page