Skip to content

Instantly share code, notes, and snippets.

@jayu
Created November 16, 2021 10:38
Show Gist options
  • Save jayu/1d4d2d17c3138b4fbeeeb8e044f25ff1 to your computer and use it in GitHub Desktop.
Save jayu/1d4d2d17c3138b4fbeeeb8e044f25ff1 to your computer and use it in GitHub Desktop.
Git hook to validate commit message with cspell (Spell checker for Visual Studio Code)
#!/bin/sh
MSG_FILE="$1"
echo "🔄 Validating message: $(cat $MSG_FILE | grep --invert-match '#')"
cspell "$MSG_FILE"
# cspell should be installed -> yarn global add cspell
# save this file in .git/hooks/commit-msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment