Skip to content

Commit

Permalink
Add found "bad words" to the output of spellcheck.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
xs5871 committed Oct 6, 2023
1 parent c805b29 commit 2867010
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions util/spellcheck.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh

if ! command -v aspell; then
echo 'aspell command not found, cannot run spell check'
Expand Down Expand Up @@ -37,11 +37,15 @@ fi
# non-interactive error report
for file in $MARKDOWN_FILES; do
# echo "cat $file | $ASPELL list"
BAD_WORDS=$($ASPELL list < "$file" )
BAD_WORDS=$($ASPELL list < "$file" | sort | uniq | tr '\n' '|')
if [ -n "$BAD_WORDS" ]; then
EXIT_STATUS=1
echo "$file still has spelling errors. To correct spelling on only this file, run the command:"
echo "$ASPELL --dont-backup -c $file"
echo \
"'$file' has spelling errors:
$(grep -Eno "$BAD_WORDS" "$file")
To correct spelling on only this file, run the command:
$ASPELL --dont-backup -c $file
"
fi
done

Expand Down

0 comments on commit 2867010

Please sign in to comment.