The commit-msg hook takes one parameter, which again is the path to a temporary file that contains the commit message written by the developer. If this script exits non-zero, Git aborts the commit process.
This git hook, developed by the Cloud team, checks the commit message for compliance with the Conventional Commits
format (see https://www.conventionalcommits.org)
Install pre-commit tools:
pip install pre-commitCreate (if it doesn't exist) a .pre-commit-config.yaml file in the root of the project:
touch .pre-commit-config.yamlAdd this content to the created file:
- repo: https://github.com/Edge-Center/edgecentercloud-git-hooks
rev: v0.0.6
hooks:
- id: edgecenter-cloud-conventional-commit
name: EdgeCenter Cloud Conventional Commit
entry: edgecenter-cloud-conventional-commit
language: python
always_run: true
stages: [ commit-msg ]Install hook using this command:
pre-commit install --install-hooksComplete!