Skip to content

Commit

Permalink
switch markdownlint container to markdownlint-cli2
Browse files Browse the repository at this point in the history
Signed-off-by: Tuomo Tanskanen <tuomo.tanskanen@est.tech>
  • Loading branch information
tuminoid committed Jan 18, 2024
1 parent 583b7ce commit c918f73
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 41 deletions.
18 changes: 0 additions & 18 deletions .markdownlinkcheck.json

This file was deleted.

12 changes: 12 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TODO: Kramdown wanted us to have 3, tho this CLI recommends 2 or 4
# TODO: Fix markdownlint issues
config:
ul-indent:
indent: 3
MD012: false
MD013: false
MD036: false
MD041: false

# Don't autofix anything, we're linting here
fix: false
33 changes: 10 additions & 23 deletions hack/markdownlint.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
#!/bin/bash

# TODO:
# Fix these two failures in future commit, and remove the ignore rules
#
# Further documentation is available for these failures:
# - MD029: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md029---ordered-list-item-prefix
# - MD013: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md013---line-length
#!/bin/sh

set -eux

IS_CONTAINER=${IS_CONTAINER:-false}
IS_CONTAINER="${IS_CONTAINER:-false}"
CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-podman}"

if [ "${IS_CONTAINER}" != "false" ]; then
TOP_DIR="${1:-.}"
find "${TOP_DIR}" \
\( -path ./vendor -o -path ./.github \) \
-prune -o -name '*.md' -exec \
mdl --style all --warnings \
--rules "~MD013,~MD029" \
{} \+
markdownlint-cli2 "**/*.md" "#node_modules"
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.8.1@sha256:7f85faca10c33e9104e0e461c2a1d59a997a52b22358548dd7975498c8311928 \
/workdir/hack/markdownlint.sh "$@"
fi

0 comments on commit c918f73

Please sign in to comment.