|
1 | | -# All documents to be used in spell check. |
2 | | -ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' | sort) |
3 | 1 | PWD := $(shell pwd) |
4 | 2 |
|
5 | 3 | # Determine OS & Arch for specific OS only tools on Unix based systems |
@@ -90,11 +88,11 @@ $(MISSPELL): |
90 | 88 |
|
91 | 89 | .PHONY: misspell |
92 | 90 | misspell: $(MISSPELL) |
93 | | - $(MISSPELL) -error $(ALL_DOCS) |
| 91 | + find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' -exec $(MISSPELL) -error {} + |
94 | 92 |
|
95 | 93 | .PHONY: misspell-correction |
96 | 94 | misspell-correction: $(MISSPELL) |
97 | | - $(MISSPELL) -w $(ALL_DOCS) |
| 95 | + find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' -exec $(MISSPELL) -w {} + |
98 | 96 |
|
99 | 97 | .PHONY: normalized-link-check |
100 | 98 | # NOTE: Search "model/*/**" rather than "model" to skip `model/README.md`, which |
@@ -127,21 +125,21 @@ markdown-link-check-local-only: normalized-link-check |
127 | 125 | .PHONY: markdown-toc |
128 | 126 | markdown-toc: |
129 | 127 | @if ! npm ls markdown-toc; then npm install; fi |
130 | | - @for f in $(ALL_DOCS); do \ |
131 | | - if grep -q '<!-- tocstop -->' $$f; then \ |
132 | | - echo markdown-toc: processing $$f; \ |
133 | | - npx --no -- markdown-toc --bullets "-" --no-first-h1 --no-stripHeadingTags -i $$f || exit 1; \ |
134 | | - elif grep -q '<!-- toc -->' $$f; then \ |
135 | | - echo markdown-toc: ERROR: '<!-- tocstop -->' missing from $$f; exit 1; \ |
| 128 | + @find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' | while read -r f; do \ |
| 129 | + if grep -q '<!-- tocstop -->' "$$f"; then \ |
| 130 | + echo markdown-toc: processing "$$f"; \ |
| 131 | + npx --no -- markdown-toc --bullets "-" --no-first-h1 --no-stripHeadingTags -i "$$f" || exit 1; \ |
| 132 | + elif grep -q '<!-- toc -->' "$$f"; then \ |
| 133 | + echo markdown-toc: ERROR: '<!-- tocstop -->' missing from "$$f"; exit 1; \ |
136 | 134 | else \ |
137 | | - echo markdown-toc: no TOC markers, skipping $$f; \ |
| 135 | + echo markdown-toc: no TOC markers, skipping "$$f"; \ |
138 | 136 | fi; \ |
139 | 137 | done |
140 | 138 |
|
141 | 139 | .PHONY: markdownlint |
142 | 140 | markdownlint: |
143 | 141 | @if ! npm ls markdownlint-cli; then npm install; fi |
144 | | - npx --no -- markdownlint-cli -c .markdownlint.yaml $(ALL_DOCS) |
| 142 | + npx --no -- markdownlint-cli -c .markdownlint.yaml "**/*.md" --ignore ./.github/ --ignore ./node_modules/ --ignore ./.git/ |
145 | 143 |
|
146 | 144 | .PHONY: install-yamllint |
147 | 145 | install-yamllint: |
|
0 commit comments