Skip to content

Commit 12d9ba1

Browse files
author
Andrew Pardoe
committed
Merge branch 'tkruse-hunspell'
2 parents 4efa0fb + 1c2f157 commit 12d9ba1

File tree

4 files changed

+581
-16
lines changed

4 files changed

+581
-16
lines changed

.travis.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,17 @@ language: c++
99
# alternatives: gcc, clang, or both (as yaml list)
1010
compiler: clang
1111

12+
addons:
13+
apt:
14+
packages:
15+
- hunspell
16+
1217
install:
1318
-
1419

1520
script:
1621
- cd scripts; make -k
1722
- cd ..
1823

19-
## find lines with tabs
20-
# - rm -f CppCoreGuidelines.md.tabs
21-
# - cat CppCoreGuidelines.md | nl -ba | sed -s 's/\(^[^\t]*\)\t/\1--/g' | grep $'\t' | sed -s 's/\t/\*\*\*\*/g' > CppCoreGuidelines.md.tabs
22-
# - if [[ -s CppCoreGuidelines.md.tabs ]]; then echo 'Tabs found'; cat CppCoreGuidelines.md.tabs; false; fi;
23-
24-
## check references unique
25-
- rm -f CppCoreGuidelines.md.uniq
26-
- grep -oP '(?<=<a name=")[^\"]+' CppCoreGuidelines.md | uniq -d > CppCoreGuidelines.md.uniq
27-
- if [[ -s CppCoreGuidelines.md.uniq ]]; then echo 'Found duplicate anchors:'; cat CppCoreGuidelines.md.uniq; false; fi;
28-
29-
3024
notifications:
3125
email: false

scripts/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ all: \
1717
check-markdown \
1818
check-references \
1919
check-notabs \
20+
hunspell-check \
2021
cpplint-all \
2122
check-badchars
2223

@@ -83,6 +84,17 @@ check-badchars: $(SOURCEPATH) $(BUILD_DIR) Makefile
8384
@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;
8485

8586

87+
.PHONY: hunspell-check
88+
hunspell-check: $(BUILD_DIR)/plain-nohtml.txt
89+
hunspell -p hunspell/isocpp.dic -u < build/plain-nohtml.txt > $(BUILD_DIR)/hunspell-report.txt
90+
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;
91+
92+
# only list words that are not in dict
93+
# to include all add them to bottom of hunspell/isocpp.dict, and run
94+
# cat hunspell/isocpp.dic | sort | uniq > hunspell/isocpp.dic2; mv hunspell/isocpp.dic2 hunspell/isocpp.dic
95+
.PHONY: hunspell-list
96+
hunspell-list: $(BUILD_DIR)/plain.txt
97+
hunspell -p hunspell/isocpp.dic -l < build/plain-nohtml.txt
8698

8799
#### Cpplint
88100

@@ -101,6 +113,9 @@ $(BUILD_DIR)/codeblocks: splitfile
101113

102114
$(BUILD_DIR)/plain.txt: splitfile
103115

116+
$(BUILD_DIR)/plain-nohtml.txt: $(BUILD_DIR)/plain.txt
117+
sed 's;<a \(name\|href\)=".*</a>;;g' $(BUILD_DIR)/plain.txt > $(BUILD_DIR)/plain-nohtml.txt
118+
104119
.PHONY: splitfile
105120
splitfile: $(SOURCEPATH) ./python/md-split.py
106121
@python ./python/md-split.py $(SOURCEPATH) $(BUILD_DIR)/plain.txt $(BUILD_DIR)/codeblocks

0 commit comments

Comments
 (0)