diff --git a/.travis.yml b/.travis.yml index 222ad98428ed7f1831a1d30f60161c06ad5c566b..74c3f373a98978229bd8567c1470c216409958a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,11 @@ language: c++ # alternatives: gcc, clang, or both (as yaml list) compiler: clang +addons: + apt: + packages: + - hunspell + install: - @@ -16,16 +21,5 @@ script: - cd scripts; make -k - cd .. -## find lines with tabs -# - rm -f CppCoreGuidelines.md.tabs -# - cat CppCoreGuidelines.md | nl -ba | sed -s 's/\(^[^\t]*\)\t/\1--/g' | grep $'\t' | sed -s 's/\t/\*\*\*\*/g' > CppCoreGuidelines.md.tabs -# - if [[ -s CppCoreGuidelines.md.tabs ]]; then echo 'Tabs found'; cat CppCoreGuidelines.md.tabs; false; fi; - -## check references unique - - rm -f CppCoreGuidelines.md.uniq - - grep -oP '(?<= CppCoreGuidelines.md.uniq - - if [[ -s CppCoreGuidelines.md.uniq ]]; then echo 'Found duplicate anchors:'; cat CppCoreGuidelines.md.uniq; false; fi; - - notifications: email: false diff --git a/scripts/Makefile b/scripts/Makefile index 468cb8c2d66f3fb8bc9fda4023e435eaaf5b8fe1..a3e28cbc93489faf11943a79c078d10c62d5d752 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -17,6 +17,7 @@ all: \ check-markdown \ check-references \ check-notabs \ +hunspell-check \ cpplint-all \ check-badchars @@ -83,6 +84,17 @@ check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile @if [ -s $(BUILD_DIR)/CppCoreGuidelines.md.badchars ]; then echo 'Warning: Undesired chars (–’‘“”¸…¦) found, use straight quotes instead:'; cat $(BUILD_DIR)/CppCoreGuidelines.md.badchars; false; fi; +.PHONY: hunspell-check +hunspell-check: $(BUILD_DIR)/plain-nohtml.txt + hunspell -p hunspell/isocpp.dic -u < build/plain-nohtml.txt > $(BUILD_DIR)/hunspell-report.txt + if [ -s $(BUILD_DIR)/hunspell-report.txt ]; then echo 'Warning: Spellcheck failed, fix words or add to dictionary:'; cat $(BUILD_DIR)/hunspell-report.txt; false; fi; + +# only list words that are not in dict +# to include all add them to bottom of hunspell/isocpp.dict, and run +# cat hunspell/isocpp.dic | sort | uniq > hunspell/isocpp.dic2; mv hunspell/isocpp.dic2 hunspell/isocpp.dic +.PHONY: hunspell-list +hunspell-list: $(BUILD_DIR)/plain.txt + hunspell -p hunspell/isocpp.dic -l < build/plain-nohtml.txt #### Cpplint @@ -101,6 +113,9 @@ $(BUILD_DIR)/codeblocks: splitfile $(BUILD_DIR)/plain.txt: splitfile +$(BUILD_DIR)/plain-nohtml.txt: $(BUILD_DIR)/plain.txt + sed 's;