Verify Markdown documents in linting workflow
Also re-order to perform shellcheck first because it requires the least installation work compared to pylint and markdownlint. The reason being if we're going to fail during shellcheck, then we fail faster (and leave heavier tasks for further down the line).
This commit is contained in:
parent
343b9babca
commit
312a763509
2 changed files with 38 additions and 2 deletions
29
scripts/verify-markdown.sh
Executable file
29
scripts/verify-markdown.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2020 Kevin Croft <krcroft@gmail.com>
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#
|
||||
# Based on `verify-bash.sh` by Patryk Obara <patryk.obara@gmail.com>
|
||||
# Copyright (C) 2019 licensed GPL-2.0-or-later
|
||||
#
|
||||
# This script exists only to easily run mdl (markdownlint) on all
|
||||
# *.md files in the repo.
|
||||
#
|
||||
# You can pass additional parameters to this script itself, e.g.:
|
||||
#
|
||||
# ./verify-markdown.sh --verbose --json
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
list_markdown_files () {
|
||||
git ls-files | grep '.md$'
|
||||
}
|
||||
|
||||
main () {
|
||||
mdl --version
|
||||
echo "Checking files:"
|
||||
list_markdown_files
|
||||
list_markdown_files | xargs -L 1000 mdl "$@"
|
||||
}
|
||||
|
||||
>&2 main "$@"
|
Loading…
Add table
Add a link
Reference in a new issue