How can I use husky to check a git commit message format?
With Husky 7+, you can add the following to .husky/commit-msg file: #!/usr/bin/env sh . “$(dirname — “$0″)/_/husky.sh” message=”$(cat $1)” requiredPattern=”^(add|cut|fix|bump|make|start|stop|refactor|reformat|optimise|document|merge) .*$” if ! [[ $message =~ $requiredPattern ]]; then echo “-” echo “-” echo “-” echo “🚨 Wrong commit message! 😕” echo “The commit message must have this format:” echo “<verb in imperative mood> <what … Read more