Skip to content

Commit

Permalink
switch markdownlint container to markdownlint-cli2
Browse files Browse the repository at this point in the history
Also fix all of the markdownlint errors.

Signed-off-by: Tuomo Tanskanen <[email protected]>
  • Loading branch information
tuminoid committed Jan 23, 2024
1 parent 3c9f391 commit 6893fb2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .markdownlint-cli2.yaml
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
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ Commit message should contain signed off section with full name and email. For e
Signed-off-by: John Doe <[email protected]>
```

When making commits, include the `-s` flag and `Signed-off-by` section will be automatically
added to your commit message. If you want GPG signing too, add the `-S` flag alongside `-s`.
When making commits, include the `-s` flag and `Signed-off-by` section
will be automatically added to your commit message. If you want GPG
signing too, add the `-S` flag alongside `-s`.

```bash
# Signing off commit
Expand Down
10 changes: 6 additions & 4 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,14 @@ Above field changes need to be made before you start upgrading your cluster.
When `spec.nodeReuse` field of metal3MachineTemplate is set to `True`, CAPM3
Machine controller:

- Sets `infrastructure.cluster.x-k8s.io/node-reuse` label to the corresponding
CAPI object name (a `controlplane.cluster.x-k8s.io` object such as `KubeadmControlPlane` or a `MachineDeployment`) on the
- Sets `infrastructure.cluster.x-k8s.io/node-reuse` label to the
corresponding CAPI object name (a `controlplane.cluster.x-k8s.io`
object such as `KubeadmControlPlane` or a `MachineDeployment`) on the
BareMetalHost during deprovisioning;
- Selects the BareMetalHost that contains
`infrastructure.cluster.x-k8s.io/node-reuse` label and matches exact same CAPI
object name set in the previous step during next provisioning.
`infrastructure.cluster.x-k8s.io/node-reuse` label and matches exact
same CAPI object name set in the previous step during next
provisioning.

Example Metal3MachineTemplate :

Expand Down
7 changes: 4 additions & 3 deletions hack/markdownlint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/sh
# markdownlint-cli2 has config file(s) named .markdownlint-cli2.yaml in the repo

set -eux

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

# all md files, but ignore .github
if [ "${IS_CONTAINER}" != "false" ]; then
TOP_DIR="${1:-.}"
find "${TOP_DIR}" -type d -path ./.github -prune -o -name '*.md' -exec mdl --style all --rules "~MD013" --warnings {} \+
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 \
docker.io/pipelinecomponents/markdownlint-cli2:0.8.1@sha256:7f85faca10c33e9104e0e461c2a1d59a997a52b22358548dd7975498c8311928 \
/workdir/hack/markdownlint.sh "$@"
fi

0 comments on commit 6893fb2

Please sign in to comment.