๐Ÿ“ฆ gimbo / overlong-py-comment-blocks-check

overlong python comment blocks pre-commit check

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/gimbo/overlong-py-comment-blocks-check.git
HTTPS git clone https://github.com/gimbo/overlong-py-comment-blocks-check.git
SSH git clone git@github.com:gimbo/overlong-py-comment-blocks-check.git
CLI gh repo clone gimbo/overlong-py-comment-blocks-check
Andy Gimblett Andy Gimblett Initial commit 34f9ad2 7 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ testing
๐Ÿ“ tests
๐Ÿ“„ .coveragerc
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ appveyor.yml
๐Ÿ“„ LICENSE.txt
๐Ÿ“„ README.md
๐Ÿ“„ setup.cfg
๐Ÿ“„ setup.py
๐Ÿ“„ tox.ini
๐Ÿ“„ README.md

Build Status Coverage Status Windows Build status

overlong-py-comment-blocks-check

This is a pre-commit hook, written for the pre-commit.com framework, which looks for python modules containing suspiciously long comment blocks (i.e. blocks of code all of whose lines begin with the "#" character, ignoring leading whitespace).

The motivation is to help with looking for dead/old/commented out code in a large codebase.

Configuration

Example .pre-commit-config.yaml entry:

  • repo: https://github.com/gimbo/overlong-py-comment-blocks-check.git
rev: master hooks:
  • id: overlong-py-comment-blocks-check
args: [--threshold=10]

The threshold argument controls how long a block must be (in lines) in order to be considered a problem; the default is 20.

Future work

  • Possibly: a way to mark a given block so that it's ignored by this
check.