diff options
author | Eric Kunze <eric.kunze@arm.com> | 2021-12-13 15:40:04 -0800 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-01-07 14:28:31 -0800 |
commit | a3eded0843874a78e69e4b985cb2a492bfab78f3 (patch) | |
tree | 18a71120e14ff64cf2acbe4463dea78cff910c5a /Makefile | |
parent | f734f1b1c81d401f7e1891c763824038501b4969 (diff) | |
download | specification-a3eded0843874a78e69e4b985cb2a492bfab78f3.tar.gz |
Add rudimentary spell check for specification
We can't easily spell check the entire specification, the
pseudocode and operator tables make it unworkable. This
adds a simple python script that tries to extract just the
description of the operators for checking. It also does a check
over the entire license.
A custom dictionary is used to contain specification custom words.
Change-Id: I74558c03af1506e2970f20b3246d920c2753ca44
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -1,7 +1,7 @@ # # This confidential and proprietary software may be used only as # authorised by a licensing agreement from ARM Limited -# (C) COPYRIGHT 2020 ARM Limited +# (C) COPYRIGHT 2020-2022 ARM Limited # ALL RIGHTS RESERVED # The entire notice above must be reproduced on all authorised # copies and copies may only be made to the extent permitted @@ -11,6 +11,7 @@ TOSAREVISION=0.24.0 draft MKDIR=mkdir -p ASCIIDOC=asciidoctor +ASPELL=aspell HTMLDIR=out/html PDFDIR=out/pdf @@ -18,13 +19,14 @@ PDFDIR=out/pdf COMMON_ARGS= -a revnumber="$(TOSAREVISION)" SPECSRC := tosa_spec.adoc -SPECFILES = $(wildcard chapters/[A-Za-z]*.adoc) tosa.css +ADOCFILES = $(wildcard chapters/[A-Za-z]*.adoc) +SPECFILES = $(ADOCFILES) tosa.css .DELETE_ON_ERROR: -.PHONY: all html pdf clean +.PHONY: all html pdf clean spell -all: html pdf +all: spell html pdf html: $(HTMLDIR)/tosa_spec.html @@ -34,6 +36,19 @@ clean: $(RM) $(HTMLDIR)/tosa_spec.html $(RM) $(PDFDIR)/tosa_spec.pdf +spell: out/spell.txt + +out/spell.txt: $(ADOCFILES) FORCE + @echo Running spell check + @mkdir -p $(@D) + @tools/get_descriptions.py $(ADOCFILES) \ + | $(ASPELL) list -v -l en-US --encoding=UTF-8 --add-extra-dicts=./tools/dictionary.dic\ + | sort -u > $@ + @-if [ -s $@ ] ; then \ + echo Spelling errors detected, check $@; \ + else echo No spelling errors found ; \ + fi + $(HTMLDIR)/tosa_spec.html: $(SPECSRC) $(SPECFILES) $(MKDIR) $(HTMLDIR) $(ASCIIDOC) -b html5 -a stylesheet=tosa.css $(COMMON_ARGS) -o $@ $< @@ -41,3 +56,6 @@ $(HTMLDIR)/tosa_spec.html: $(SPECSRC) $(SPECFILES) $(PDFDIR)/tosa_spec.pdf: $(SPECSRC) $(SPECFILES) $(MKDIR) $(PDFDIR) $(ASCIIDOC) -r asciidoctor-pdf -b pdf $(COMMON_ARGS) -o $@ $(SPECSRC) + +.PHONY: FORCE +FORCE: |