From 3eddaae8823c4550aa07090d4d819a6543db7a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Sun, 10 Oct 2021 15:45:57 +0100 Subject: [PATCH] examples: add a %.spellok helper to check spelling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Usage: `make -C examples/tutorial_en tutorial_en.spellok` This will output a list of incorrect words (which should be empty). Catala-specific words (or uncommon words missing from the default aspell dictionary) can be added to examples/whitelist. Signed-off-by: Edwin Török --- .gitignore | 4 +++- examples/Makefile.common.mk | 6 ++++++ examples/whitelist.en | 3 +++ examples/whitelist.fr | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 examples/whitelist.en create mode 100644 examples/whitelist.fr diff --git a/.gitignore b/.gitignore index ddc2e9e5..883b16ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ _build/ _opam/ *.install +*.spellok +*.catala*.errors compiler/**/.merlin legifrance_oauth* *.html -.vscode/ \ No newline at end of file +.vscode/ diff --git a/examples/Makefile.common.mk b/examples/Makefile.common.mk index 24a77b7e..3ae207f3 100644 --- a/examples/Makefile.common.mk +++ b/examples/Makefile.common.mk @@ -56,6 +56,12 @@ help : ../Makefile.common.mk HTML \ $< +%.spellok: %.catala_$(CATALA_LANG) ../whitelist.$(CATALA_LANG) + aspell list --lang=$(CATALA_LANG) --mode=markdown --camel-case --add-wordlists=../whitelist.$(CATALA_LANG) <$< | tee "$<".errors + @# list of mispelled words must be empty + @test ! -s "$<".errors + @touch $@ + ########################################## # Misceallenous diff --git a/examples/whitelist.en b/examples/whitelist.en new file mode 100644 index 00000000..eb2d2902 --- /dev/null +++ b/examples/whitelist.en @@ -0,0 +1,3 @@ +catala +enum +durations diff --git a/examples/whitelist.fr b/examples/whitelist.fr new file mode 100644 index 00000000..54ec9234 --- /dev/null +++ b/examples/whitelist.fr @@ -0,0 +1 @@ +catala