π Problem:
Comment style issues slow down code reviews. Missing spaces, bad capitalization, or empty # commentsβwhy waste time on that?
π‘ Solution:
Use pre-commit to automate comment checks in Python! It ensures:
β
Correct spacing after #
β
Proper capitalization in comments
β
No empty or redundant comments
β‘ How to Set It Up?
π Install pre-commit:
pip install pre-commit
π Add this to .pre-commit-config.yaml:
- repo: http://gitlab.com/krash/python-checker
rev: v0.0.7
hooks:
- id: python-check
π Enable it:
pre-commit install
Now, every commit automatically checks your comment style before pushing!
π Read more + full guide π https://medium.com/pythoneers/automate-python-comment-checks-with-pre-commit-1373220e5286
Top comments (0)