A collection of prepare message and commit message git hooks for use with the pre-commit framework. For details see the list of available hooks below.
Add this to your .pre-commit-config.yaml
:
- repo: https://github.com/boidolr/pre-commit-msg
rev: v1.3.2 # Use the ref you want to point at
hooks:
- id: format-message
# - id: ...
For an extended example see .pre-commit-config.yaml
.
prepare-message
: Change commit messages to include a prefix.--ignore-branch
will lead to the branch not being checked.--pattern
can be used to change the feature branch pattern to take the message prefix from. Needs to match with--prefix-pattern
. Defaults tofeature/(\w+-\d+)
.--prefix-pattern
should match the prefix of the message to normalize it. Needs to match with--pattern
. Defaults to^\s*\w+-\d+\s*:
format-message
: Ensure commit message conforms to format of headline followed by two empty lines.--capitalize
if the subject line should be capitalized. Other lines remain unchanged.