-
Notifications
You must be signed in to change notification settings - Fork 163
/
Makefile
45 lines (36 loc) · 1.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# All documents to be used in spell check.
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
TOOLS_DIR := ./.tools
MISSPELL_BINARY=$(TOOLS_DIR)/misspell
MARKDOWN_LINK_CHECK=markdown-link-check
.PHONY: install-misspell
install-misspell:
go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell
.PHONY: misspell
misspell:
$(MISSPELL_BINARY) -error $(ALL_DOCS)
.PHONY: misspell-correction
misspell-correction:
$(MISSPELL_BINARY) -w $(ALL_DOCS)
.PHONY: install-markdown-link-check
install-markdown-link-check:
npm install -g $(MARKDOWN_LINK_CHECK)
.PHONY: markdown-link-check
markdown-link-check:
find . -name \*.md -exec sleep 5 \; -exec $(MARKDOWN_LINK_CHECK) {} \;
.PHONY: enforce-markdown-link-check
enforce-markdown-link-check:
@LINKCHECKOUT=`find . -name \*.md -exec sleep 5 \; -exec $(MARKDOWN_LINK_CHECK) {} 2>&1 >/dev/null \;`; \
if [ "$$LINKCHECKOUT" ]; then \
echo "$(MARKDOWN_LINK_CHECK) FAILED => errors:\n"; \
echo "Run 'make $(MARKDOWN_LINK_CHECK)' to see the errors"; \
exit 1; \
else \
echo "Check markdown links finished successfully"; \
fi
.PHONY: install-markdown-lint
install-markdown-lint:
npm install -g markdownlint-cli@0.30.0
.PHONY: markdown-lint
markdown-lint:
markdownlint -c .markdownlint.yaml '**/*.md'