Skip to content

Commit 4d908d8

Browse files
committed
Add pre-commit check for the order of aspell dict
Suggested-by: Jim Huang <[email protected]> Change-Id: Iff9a9eaed081f340ecbec758e741a3fb66863753
1 parent 1527f93 commit 4d908d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/pre-commit.hook

+8
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ if [ "${#SHELL_FILES[@]}" -gt 0 ]; then
222222
done
223223
fi
224224

225+
ASPELL_DICT_FILE='scripts/aspell-pws'
226+
if ! tail -n +2 $ASPELL_DICT_FILE | sort -cdu; then
227+
throw '%s\n%s\n%s' \
228+
'Aspell dictionary is unsorted or contains duplicated entries.' \
229+
'Make sure that by using:' \
230+
" tail -n +2 $ASPELL_DICT_FILE | sort -du"
231+
fi
232+
225233
# Show insertion and deletion counts.
226234
if [ "${#FILES[@]}" -gt 0 ]; then
227235
echo "Following files were changed:"

0 commit comments

Comments
 (0)