-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (43 loc) · 1.43 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
46
47
48
49
SHELL := /usr/bin/env bash # Use bash shell
testArgs := # Project-wide arguments
testPattern := **/*.md # File pattern to operate on
ignorePattern := !**/node_modules/**/*.md # File pattern to ignore
#---------- Sensitivity check ----------#
.PHONY: offensive-wording
offensive-wording:
@echo
@echo "==> Checking for inconsiderate/insensitive wording..."
@node_modules/.bin/alex $(testArgs) --diff || true
#---------- Auto spellcheck ----------#
.PHONY: spellcheck-auto
spellcheck-auto:
@$(MAKE) spellcheck-interactive \
testArgs=--report
#---------- Interactive spellcheck ----------#
.PHONY: spellcheck-interactive
spellcheck-interactive:
@echo
@echo "==> Checking for spelling errors..."
@node_modules/.bin/mdspell \
$(testArgs) \
--en-gb \
--ignore-numbers \
--ignore-acronyms \
$(testPattern) \
$(ignorePattern)
#---------- Linter ----------#
.PHONY: lint-markdown
lint-markdown:
@echo
@echo "==> Checking for messy formatting..."
@node_modules/.bin/remark --frail $(testArgs) .
#---------- Local runner ----------#
.PHONY: test-pre-commit
test-pre-commit: offensive-wording spellcheck-interactive lint-markdown
@echo
@echo "--- Resolve any warnings or errors above before committing to version control. ---"
#---------- CI runner ----------#
.PHONY: test
test: offensive-wording spellcheck-auto lint-markdown
@echo
@echo "--- All fatal tests passed. See output above for any warnings. ---"