Skip to content

Commit 69f0a8c

Browse files
trasklaurit
andauthored
Use mise to run markdown linting (#15455)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent 4236eca commit 69f0a8c

File tree

5 files changed

+32
-20
lines changed

5 files changed

+32
-20
lines changed

.github/config/.markdownlint-cli2.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/reusable-markdown-lint-check.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1414

15+
- uses: jdx/mise-action@9dc7d5dd454262207dea3ab5a06a3df6afc8ff26 # v3.4.1
16+
1517
- name: Run markdownlint
1618
run: |
17-
npx [email protected] --config .github/config/.markdownlint-cli2.yaml "**/*.md"
19+
if ! mise run lint:markdown; then
20+
echo "markdownlint failed. To auto-fix many issues locally, run:"
21+
echo " mise run lint:markdown --fix"
22+
exit 1
23+
fi

.markdownlint.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
2+
# and https://github.com/DavidAnson/markdownlint-cli2
3+
4+
ul-style: false
5+
line-length: false
6+
no-duplicate-heading:
7+
siblings_only: true
8+
ol-prefix:
9+
style: ordered
10+
no-inline-html: false
11+
fenced-code-language: false
12+
no-trailing-punctuation:
13+
punctuation: ".,;:" # allowing exclamation points and question marks at end of sentences

.mise/tasks/lint/markdown.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
#MISE description="Lint markdown files"
3+
#MISE flag "--fix" help="Automatically fix issues"
4+
5+
set -e
6+
7+
if [ "${usage_fix}" = "true" ]; then
8+
markdownlint-cli2 --fix "**/*.md" "#**/build" "#CHANGELOG.md" "#licenses/licenses.md"
9+
else
10+
markdownlint-cli2 "**/*.md" "#**/build" "#CHANGELOG.md" "#licenses/licenses.md"
11+
fi

mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tools]
22
lychee = "0.21.0"
3+
markdownlint-cli2 = "0.17.1"
34

45
[settings]
56
# Only install tools explicitly defined in the [tools] section above

0 commit comments

Comments
 (0)