aboutsummaryrefslogtreecommitdiff
path: root/build-aux/assert-spelling.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux/assert-spelling.sh')
-rwxr-xr-xbuild-aux/assert-spelling.sh35
1 files changed, 0 insertions, 35 deletions
diff --git a/build-aux/assert-spelling.sh b/build-aux/assert-spelling.sh
deleted file mode 100755
index 33da3e3..0000000
--- a/build-aux/assert-spelling.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-set -eu
-
-export LANG=C.UTF-8
-export JEKYLL_ENV=production
-
-for DICT in build-aux/spelling/*.txt; do
- sort "$DICT" | diff - "$DICT" || {
- echo "The $DICT dictionary is unsorted. To fix it, run:" >&2
- echo " LANG=C.UTF-8 sort $DICT | sponge $DICT" >&2
- exit 1
- }
-done
-
-OUT="$(mktemp)"
-jekyll build --future --trace
-# shellcheck disable=2044
-for f in $(find _site -type f -name '*.html'); do
- if ! echo "$f" | grep -qE '(/vendor/|TODOs.html)'; then
- l="$(head -n2 "$f" | tail -n1 | cut -d\" -f2)"
- CURR_DICT="$(mktemp)"
- cat build-aux/spelling/international.txt "build-aux/spelling/$l.txt" > "$CURR_DICT"
- hunspell -u3 -H -d "$l" -p "$CURR_DICT" "$f" | tee -a "$OUT"
- fi
-done
-
-if [ -s "$OUT" ]; then
- printf "\nvvv Mispelled words detected by hunspell.\n\n"
- cut -d\ -f2- < "$OUT" | sort | uniq
- printf "\n^^^\n" >&2
- exit 1
-else
- echo "No spelling errors detected"
- exit 0
-fi