-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1338 from Nordix/tuomo/switch-to-markdownlint-cli2
switch markdownlint container to markdownlint-cli2
- Loading branch information
Showing
3 changed files
with
37 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Reference: https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2yaml | ||
|
||
config: | ||
ul-indent: | ||
# Kramdown wanted us to have 3 earlier, tho this CLI recommends 2 or 4 | ||
indent: 3 | ||
|
||
# Don't autofix anything, we're linting here | ||
fix: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
#!/bin/sh | ||
# markdownlint-cli2 has config file(s) named .markdownlint-cli2.yaml in the repo | ||
|
||
set -eux | ||
|
||
IS_CONTAINER=${IS_CONTAINER:-false} | ||
IS_CONTAINER="${IS_CONTAINER:-false}" | ||
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}" | ||
|
||
# all md files, but ignore .github | ||
if [ "${IS_CONTAINER}" != "false" ]; then | ||
TOP_DIR="${1:-.}" | ||
# TODO: Fix the line length issue in README table and remove ignoring MDD013 | ||
# inline markdown ignore is not working | ||
find "${TOP_DIR}" -type f \( -iname "vars.md" \) -prune -o -name '*.md' -exec mdl --style all --warnings --rules "~MD013" {} \+ | ||
markdownlint-cli2 "**/*.md" "#.github" | ||
else | ||
"${CONTAINER_RUNTIME}" run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/workdir:ro,z" \ | ||
--entrypoint sh \ | ||
--workdir /workdir \ | ||
docker.io/pipelinecomponents/markdownlint:0.13.0@sha256:9c0cdfb64fd3f1d3bdc5181629b39c2e43b6a52fc9fdc146611e1860845bbae0 \ | ||
/workdir/hack/markdownlint.sh "$@" | ||
"${CONTAINER_RUNTIME}" run --rm \ | ||
--env IS_CONTAINER=TRUE \ | ||
--volume "${PWD}:/workdir:ro,z" \ | ||
--entrypoint sh \ | ||
--workdir /workdir \ | ||
docker.io/pipelinecomponents/markdownlint-cli2:0.9.0@sha256:71370df6c967bae548b0bfd0ae313ddf44bfad87da76f88180eff55c6264098c \ | ||
/workdir/hack/markdownlint.sh "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters