Skip to content

Commit 4d828d9

Browse files
committed
Validate markdownlint configuration file against its JSON schema
1 parent 27e0b6a commit 4d828d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Taskfile.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,18 @@ tasks:
8787
DEPENDABOT_SCHEMA_PATH:
8888
sh: mktemp -t dependabot-schema-XXXXXXXXXX.json
8989
DEPENDABOT_DATA_PATH: "**/dependabot.yml"
90+
# Source: https://github.com/DavidAnson/markdownlint/blob/main/schema/markdownlint-config-schema.json
91+
# Note: temporarily using schema from `next` branch due to bug in the one on `main`.
92+
# (https://github.com/DavidAnson/markdownlint/pull/406).
93+
MARKDOWNLINT_SCHEMA_URL: https://raw.githubusercontent.com/DavidAnson/markdownlint/next/schema/markdownlint-config-schema.json
94+
MARKDOWNLINT_SCHEMA_PATH:
95+
sh: mktemp -t markdownlint-schema-XXXXXXXXXX.json
96+
MARKDOWNLINT_DATA_PATH: "**/.markdownlint.{yml,yaml}"
9097
cmds:
9198
- wget --quiet --output-document="{{.DEPENDABOT_SCHEMA_PATH}}" {{.DEPENDABOT_SCHEMA_URL}}
9299
- npx ajv-cli@{{.AJV_CLI_VERSION}} validate -s "{{.DEPENDABOT_SCHEMA_PATH}}" -d "{{.DEPENDABOT_DATA_PATH}}"
100+
- wget --quiet --output-document="{{.MARKDOWNLINT_SCHEMA_PATH}}" {{.MARKDOWNLINT_SCHEMA_URL}}
101+
- npx ajv-cli validate --allow-union-types -s "{{.MARKDOWNLINT_SCHEMA_PATH}}" -d "{{.MARKDOWNLINT_DATA_PATH}}"
93102

94103
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
95104
markdown:lint:

0 commit comments

Comments
 (0)