diff options
author | EuAndreh <eu@euandre.org> | 2020-10-11 03:56:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-10-11 04:19:20 -0300 |
commit | 6d2fae4d2749d893f5d027d5b4756e709a3847af (patch) | |
tree | d99d02b8039e233d2e5ae833b2752ef144274ffc /spelling/check-spelling.sh | |
parent | Mark slides + article on feature flags as unpublished (diff) | |
download | euandre.org-6d2fae4d2749d893f5d027d5b4756e709a3847af.tar.gz euandre.org-6d2fae4d2749d893f5d027d5b4756e709a3847af.tar.xz |
Decouple testing with Nix
Use Nix for build isolation not for test running.
Diffstat (limited to '')
-rwxr-xr-x | spelling/check-spelling.sh | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/spelling/check-spelling.sh b/spelling/check-spelling.sh deleted file mode 100755 index 3ddfd2a..0000000 --- a/spelling/check-spelling.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -HTML_DIR="${1:-}" -[[ -z "${HTML_DIR}" ]] && { - echo 'Undefined input HTML_DIR.' >&2 - exit 2 -} - -# Required by =sort= and =hunspell= -export LANG=C.UTF-8 - -for DICT in spelling/*.txt; do - diff <(sort "$DICT" | uniq) "$DICT" || { - echo "The $DICT dictionary is unsorted. To fix it, run:" >&2 - echo " LANG=C.UTF-8 sort $DICT | uniq | sponge $DICT" >&2 - exit 1 - } -done - -rm -f spelling.txt -shopt -s globstar -for f in "${HTML_DIR}"/**/*.html; do - if ! grep -E '/pastebin(/|s.html)' <(echo "$f") > /dev/null; then - l="$(head -n2 "$f" | tail -n1 | cut -d\" -f2)" - hunspell -u3 -H -d "$l" -p <(cat spelling/international.txt "spelling/$l.txt") "$f" | tee -a spelling.txt - fi -done - -if [[ -s spelling.txt ]]; then - printf "\nvvv Mispelled words detected by hunspell.\n\n" >&2 - sort < spelling.txt | uniq >&2 - printf "\n^^^\n" >&2 - exit 1 -else - echo "No words mispelled" >&2 -fi |