Git Hook Spellchecker忽略缩进线

mel*_*oth 2 git hook ignore aspell

我正在编写一个git钩子,拼写检查我的提交消息.这是我到目前为止:

#!/bin/sh

ASPELL=$(which aspell)

WORDS=$($ASPELL list < "$1")

if [ -n "$WORDS" ]; then
    echo -e "Possible spelling errors found in commit message. Consider using git commit --amend to change the message.\n\tPossible mispelled words: " $WORDS
fi
Run Code Online (Sandbox Code Playgroud)

我不知道如何告诉aspell我想忽略缩进的行(两个或多个空格).这将避免有关文件名,注释等的恼人消息.

谢谢!

Pho*_*reo 5

你有机会做EECS 398吗?

只是给你一个提示而不破坏荣誉代码.

将提交消息放入文本文件中.使用文本编辑器从文本文件中删除缩进行.然后通过aspell放入文本文件.