Skip to content

Validate Commit Message

David Ortner edited this page Jan 29, 2024 · 2 revisions

Validates the message inside a Git commit file.

This is useful in combination with a tool like Husky.

Usage

Basic Usage

happy-validate-commit-message --commitFile={commitFile}

With Husky

  1. Install Husky
  2. Create the file ".husky/commit-msg"
  3. Add the following to the file ".husky/commit-msg":
    #!/bin/sh
    . "$(dirname "$0")/_/husky.sh"
    ./node_modules/.bin/happy-validate-commit-message --commitFile=$1