forked from Mirror/pmbootstrap
CI: add markdown lint (MR 2485)
Add a CI job to enforce markdown linting Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
67773c4293
commit
14d9134d8b
2 changed files with 28 additions and 0 deletions
23
.ci/markdown.sh
Executable file
23
.ci/markdown.sh
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh -e
|
||||
# Description: lint all markdown files
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk add npm
|
||||
npm install -g markdownlint-cli
|
||||
ln -sf /usr/local/lib/node_modules/markdownlint-cli/markdownlint.js /usr/bin/markdownlint-cli
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
MDL_FAILED=0
|
||||
find . -name '*.md' |
|
||||
while read -r file; do
|
||||
echo "mdl: $file"
|
||||
markdownlint-cli "$file" || MDL_FAILED=1
|
||||
done
|
||||
|
||||
if [ "$MDL_FAILED" = "1" ]; then
|
||||
echo "markdown lint failed!"
|
||||
exit 1
|
||||
fi
|
|
@ -30,6 +30,11 @@ codespell:
|
|||
script:
|
||||
- ".ci/codespell.sh"
|
||||
|
||||
markdownlint:
|
||||
stage: test
|
||||
script:
|
||||
- ".ci/markdown.sh"
|
||||
|
||||
pytest:
|
||||
stage: test
|
||||
script:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue