Basic commit checker, with optional emoji check
A basic git commit message format checker.
Note: check out https://github.com/jorisroovers/gitlint for a much better,
more featureful, and actually tested implementation! the only unique feature in
py-commit-checker is the built in leading emoji check... 😀
Small set of mandatory (cannot be disabled) and optional (opt in or out) checkers.
These checks are always enabled:
- mandatory blank second line (delimiting title + body of message)
These checks can be set to on or off using command line args:
- 50/72 rule checking (configurable lengths)
- leading emoji check
Returns non-zero in case of any violation
pip install py-commit-checker # note: you'll need git installed for the gitpython dependency to work!
# check top commit for 50/72 + emoji compliance on HEAD py-commit-checker --emojis # check a specific commit py-commit-checker --emojis --commit HEAD~2 # check a repo at a path other than cwd py-commit-checker --repo-path ../openbsd # check a range of commits; py-commit-checker-branch helper script (installed # alongside py-commit-checker) PY_COMMIT_CHECKER_ARGS='--emojis' py-commit-checker-branch origin/master
Why is this not just a single regex
Because I was too lazy to figure out how to exclude URI elements from the body line length check in regex 🐸☕.
Also distributing with pypi is pretty convenient 😀
This package uses tox. To run the tests locally:
pip install tox==3.7.0 # minimum supported version tox --parallel auto # run tox in parallel
This is a py2+3 universal package; it's recommended you install python3.6 with whatever your system package manager is, if it isn't already installed, so tox can run the checks for that too.
Tox will enforce 100% pylint compliance, and black formatting compliance.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for py_commit_checker-0.3.1-py2.py3-none-any.whl