A set of pre-commit hooks we found useful.
This repository contains various pre-commit hooks we're just starting to collect.
- Runs on:
prepare-commit-msg
We use Jira for our ticket management, and our branches usually follow the feature/proj-103-short-description
method.
This command adds the commit message to the start of the commit.
The code is inspired on the work of Wiktor Malinowski's article "How To Prefix Your Commit Message With a Ticket Number Automatically", but with some changes to suit our programming style.
To install this, add the following to your repository's .pre-commit-config.yaml
repos:
# …
- repo: https://github.com/motivozwolle/pre-commit-hooks
hooks:
- id: add-ticket-to-commit
- Runs on:
commit
Checks the bash scripts in the repository against shellcheck
for common errors.
To install this, add the following to your repository's .pre-commit-config.yaml
repos:
# …
- repo: https://github.com/motivozwolle/pre-commit-hooks
hooks:
- id: shellcheck