Skip to content

Commit 927220e

Browse files
authored
Merge pull request #18 from per1234/validate-markdownlint-config
Validate markdownlint configuration file against its JSON schema
2 parents 34f8235 + bc40a9b commit 927220e

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
@@ -94,10 +94,19 @@ tasks:
9494
DEPENDABOT_DATA_PATH: "**/dependabot.yml"
9595
LABEL_CONFIG_SCHEMA_PATH: workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
9696
LABEL_CONFIG_DATA_PATH: "workflow-templates/assets/sync-labels/*.{yml,yaml}"
97+
# Source: https://github.com/DavidAnson/markdownlint/blob/main/schema/markdownlint-config-schema.json
98+
# Note: temporarily using schema from `next` branch due to bug in the one on `main`.
99+
# (https://github.com/DavidAnson/markdownlint/pull/406).
100+
MARKDOWNLINT_SCHEMA_URL: https://raw.githubusercontent.com/DavidAnson/markdownlint/next/schema/markdownlint-config-schema.json
101+
MARKDOWNLINT_SCHEMA_PATH:
102+
sh: mktemp -t markdownlint-schema-XXXXXXXXXX.json
103+
MARKDOWNLINT_DATA_PATH: "**/.markdownlint.{yml,yaml}"
97104
cmds:
98105
- wget --quiet --output-document="{{.DEPENDABOT_SCHEMA_PATH}}" {{.DEPENDABOT_SCHEMA_URL}}
99106
- npx ajv-cli@{{.AJV_CLI_VERSION}} validate -s "{{.DEPENDABOT_SCHEMA_PATH}}" -d "{{.DEPENDABOT_DATA_PATH}}"
100107
- npx ajv-cli validate -s "{{.LABEL_CONFIG_SCHEMA_PATH}}" -d "{{.LABEL_CONFIG_DATA_PATH}}"
108+
- wget --quiet --output-document="{{.MARKDOWNLINT_SCHEMA_PATH}}" {{.MARKDOWNLINT_SCHEMA_URL}}
109+
- npx ajv-cli validate --allow-union-types -s "{{.MARKDOWNLINT_SCHEMA_PATH}}" -d "{{.MARKDOWNLINT_DATA_PATH}}"
101110

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

0 commit comments

Comments
 (0)