Welcome to mirror list, hosted at ThFree Co, Russian Federation.

verify-markdown.sh « scripts - github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f885db8b1692e27efb51c8cbb4ec2670bbf69ebb (plain)
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
#!/bin/bash

# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2020-2021  kcgen <kcgen@users.noreply.github.com>
#
# This is a convenient helper to run mdl (markdownlint) on the
# *.md files in the repo, except for those inside directories
# that are likely to hold 3rd party documentation.
#
# You can pass additional mdl arguments to this script itself, e.g.:
#
#   ./verify-markdown.sh --verbose --json

set -euo pipefail

list_markdown_files () {
	git ls-files -- \
	  '*.md' \
	  ':!:src/libs/*.md' \
	  ':!:docs/ReelMagic/*.md' \
	  ':!:contrib/resources/*.md'
}

main () {
	repo_root="$(git rev-parse --show-toplevel)"
	mdl --version
	echo "Checking files:"
	list_markdown_files
	list_markdown_files | xargs -L 1000 mdl --style "$repo_root/.mdl-styles" "$@"
}

>&2 main "$@"