Skip to main content

The linter to detect undesirable words and phrases in comments.

Project description

tests Code style: black License: MIT

PyBadComments Linter

A Python code linter designed to find banned words/phrases in Python comments and raise a warning.

A list of words and phrases can be supplied to the library in its pyproject.toml configuration and it will search any given files for those words in the comments and raise a warning, pointing to the exact line and offending word that has caused the warning. It uses regex and will match the exact characters in the strings provided, including any whitespace.

It can be installed as a pre-commit hook to allow for pre-commit linting.

References

Inspired and aided by tryceratops

Testing

Samples

Sample files for testing on can be provided in the 'samples' folder. These files act like real Python scripts upon which the linter can be run to test for banned words.

Feel free to add any sample files needed to test unique cases.

Testing code without a sample file

It is possible to provide Python code as a string and test upon that in test files.

[WIP] Need to ensure the code is setup to allow this.

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

pybadcomments-0.2.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

pybadcomments-0.2.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pybadcomments-0.2.1.tar.gz.

File metadata

  • Download URL: pybadcomments-0.2.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for pybadcomments-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ba25bbc243c506dbb84be4bf029c7f507611755dbaaba3cb1daf45f57410152f
MD5 b42529abdbfc84085ed793f24c8e089e
BLAKE2b-256 a43ae13d79475f1c95103963b675dba22333ac0aafbcb462d0aacc91f7a2f2b0

See more details on using hashes here.

File details

Details for the file pybadcomments-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pybadcomments-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19395a344860d79f19271ca4a13df949ad3f88b90f8d8c32daf5a04f4a0768af
MD5 9f7561480e6c30eae845d9af19224eeb
BLAKE2b-256 5a1ab3c49993d65ed8d776c33565cc88d5542d2f0174b4b0653e8b5bec7f0916

See more details on using hashes here.

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