1
0
Fork 0
mirror of https://github.com/corona-warn-app/cwa-documentation synced 2025-07-04 20:38:37 +02:00

feat: Use makefile targets for document linting (#215)

This Makefile provides several targets for linting
documents. It utilizes several npm packages.
Functionality includes:

* Spellcheck
* Linting of markdown
* Check for broken links
* Sorting of dictionary file
* Detect inconsidered language

All targets (excluding the sorting of the dict file) are part
of the Github Action pipeline and will fail if quality
standards are not met.

Signed-off-by: Johannes Amorosa <johannes.amorosa@endocode.com>
This commit is contained in:
Johannes Amorosa 2020-07-05 15:37:23 +02:00 committed by GitHub
parent f44275d4b1
commit 02caed10d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 4073 additions and 47 deletions

34
Makefile Normal file
View file

@ -0,0 +1,34 @@
.PHONY: all install check markdownlint clean checklinks spellcheck-en spellcheck detect-inconsiderate-language
SHELL := /bin/bash
export PATH := ./node_modules/.bin:$(PATH)
install:
# https://stackoverflow.com/a/56254478
npm ci
check: markdownlint checklinks spellcheck format-spelling detect-inconsiderate-language
spellcheck: spellcheck-en
spellcheck-en:
mdspell '**/*.md' --en-us -t -n -a --report \
'!**/node_modules/**/*.md' \
'!**/.github/**/*.md' \
'!**/translations/**/*.md'
markdownlint:
markdownlint '**/*.md' --ignore node_modules
checklinks:
# https://github.com/tcort/markdown-link-check/issues/57
find . -not -path "*node_modules*" -not -path "*.github*" -name \*.md | \
xargs -n 1 markdown-link-check
detect-inconsiderate-language:
alex
format-spelling:
sort < .spelling | sort | uniq | tee .spelling.tmp > /dev/null && mv .spelling.tmp .spelling
clean:
rm -rf node_modules