diff --git a/.githooks/commit-msg b/.githooks/commit-msg index c661fc5e0..fb7febbc5 100755 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -1,4 +1,7 @@ -#!/usr/bin/env bash +#!/bin/sh + +RED="\033[0;31m" +END_COLOR="\033[0m" commit_types="(chore|docs|feat|fix|refactor|tests?)" conventional_commit_regex="^${commit_types}(\([a-z \-]+\))?!?: .+$" @@ -9,11 +12,15 @@ if [[ "$commit_message" =~ $conventional_commit_regex ]]; then echo -e "Commit message meets Conventional Commit standards..." exit 0 fi + echo + echo "${RED}Commit lint failed. Please update your commit message format. ${END_COLOR}" + echo "Example commit messages:" + echo " feat(scope): add your feature description here" + echo " fix(scope): add your fix description here" + echo " chore(scope): add your chore description here" + echo " docs(scope): add your docs description here" + echo " refactor(scope): add your refactor description here" + echo " tests(scope): add your tests description here" + echo - -echo -e "The commit message does not meet the Conventional Commit standard" -echo "An example of a valid message is: " -echo " feat(login): add the 'remember me' button" -echo "More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary" - -exit 1 +exit 1 \ No newline at end of file