From 3e40a48332d8c2882de1305cabe1aec4fec7e4f1 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 22 Jan 2018 10:49:30 +0100 Subject: [PATCH] Add lightning spell check --- Makefile | 5 ++++- tools/check-spelling.sh | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 tools/check-spelling.sh diff --git a/Makefile b/Makefile index 43aed7c8d..8ce869b66 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,10 @@ check-whitespace: check-whitespace/Makefile check-whitespace/tools/check-bolt.c check-markdown: @tools/check-markdown.sh -check-source: check-makefile check-source-bolt check-whitespace check-markdown +check-spelling: + @tools/check-spelling.sh + +check-source: check-makefile check-source-bolt check-whitespace check-markdown check-spelling full-check: check check-source diff --git a/tools/check-spelling.sh b/tools/check-spelling.sh new file mode 100755 index 000000000..082ddf709 --- /dev/null +++ b/tools/check-spelling.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +git grep -iE 'l[ightn]{6}g|l[ightn]{8}g|ilghtning|lgihtning|lihgtning|ligthning|lighnting|lightinng|lightnnig|lightnign' -- . ':!tools/check-spelling.sh' +if [[ $? == 0 ]]; then + echo "Identified a likely misspelling of the word \"lightning\" (see above). Please fix." + echo "Is this warning incorrect? Please teach tools/check-spelling.sh about the exciting new word." + exit 1 +fi