Skip to content

Instantly share code, notes, and snippets.

@homam
Created October 31, 2015 15:41
Show Gist options
  • Select an option

  • Save homam/58a7e98f8fdb0f3034ee to your computer and use it in GitHub Desktop.

Select an option

Save homam/58a7e98f8fdb0f3034ee to your computer and use it in GitHub Desktop.
git commit spell checker
#!/bin/zsh
# brew install aspell
# nano .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
ASPELL=$(which aspell)
if [ $? -ne 0 ]; then
echo "Aspell not installed - unable to check spelling" >&2
exit
else
WORDS=$($ASPELL list < "$1")
fi
if [ -n "$WORDS" ]; then
echo -e "\e[1;33m\t\n\tPossible mispelled words: \n\n"$WORDS"\n\e[0m" >&2
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment