diff --git a/.husky/commit-msg b/.husky/commit-msg index b56767669..0659aa1c2 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,11 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npx --no -- commitlint --edit "$1" +# Only check commit message if commit on master or first commit on another +# branch to avoid bothering fix commits after reviews +# +# FIXME: does not properly run with git commit --amend +if [ "$(git rev-parse --abbrev-ref HEAD)" = master ] || [ "$(git rev-list --count master..)" -eq 0 ] +then + npx --no -- commitlint --edit "$1" +fi