Some out-of-the-box hooks for pre-commit.
See also: https://github.com/pre-commit/pre-commit
Add this to your .pre-commit-config.yaml
- repo: https://github.com/SARC-MedIQ/pre-commit-hooks
rev: 1.0.0 # Use the ref you want to point at
hooks:
- id: check-branch-nameCheck the branch name meets the format requirements
-p, --pattern- Provide pattern the branch must match (default [a-z]{2,5)-\d+-[a-z0-9-]+), can be used multiple times
Note that check-branch-name is configured by default to always_run.
As a result, it will ignore any setting of files,
exclude, types
or exclude_types.
Set always_run: false to allow this hook to be skipped according to these
file filters. Caveat: In this configuration, empty commits (git commit --allow-empty) would always be allowed by this hook.