๐ 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)