Skip to content

Commit 64e29c5

Browse files
authored
Use mise for running markdownlint (#2478)
1 parent ea62954 commit 64e29c5

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ When implementing changes or new features:
6363
1. Follow all [Style Guide](../docs/style-guide.md) conventions and the Code Review Priorities above
6464
2. Run tests to ensure they still pass (use `./gradlew test` and `./gradlew integrationTest` as needed)
6565
3. **Always run `./gradlew spotlessApply`** after making code changes to ensure proper formatting
66-
4. Run markdown lint to ensure it still passes: `npx [email protected] --config .github/config/.markdownlint-cli2.yaml "**/*.md"`
66+
4. Run markdown lint to ensure it still passes: `mise run lint:markdown`

.github/workflows/reusable-markdown-lint.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" "#**/node_modules" "#CHANGELOG.md" "#ibm-mq-metrics/docs/metrics.md" "#.github/pull_request_template.md"
9+
else
10+
markdownlint-cli2 "**/*.md" "#**/build" "#**/node_modules" "#CHANGELOG.md" "#ibm-mq-metrics/docs/metrics.md" "#.github/pull_request_template.md"
11+
fi

mise.toml

Lines changed: 4 additions & 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
@@ -10,3 +11,6 @@ idiomatic_version_file_enable_tools = []
1011
windows_executable_extensions = ["sh"]
1112
windows_default_file_shell_args = "bash"
1213
use_file_shell_for_executable_tasks = true
14+
15+
[tasks."lint:markdown"]
16+
file = ".mise/tasks/lint/markdown.sh"

0 commit comments

Comments
 (0)