Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
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.
python3 -m pip install flake8-comments
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
There are a few more good flake8 plugins targeted on cleaning up comments:
noqa
, no cover
, bad shebangs.FAQs
Find redundant comments in Python code
We found that flake8-comments demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.