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.3 # 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-branchwill lead to the branch not being checked.--patterncan 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-patternshould 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.--capitalizeif the subject line should be capitalized. Other lines remain unchanged.