Skip to content

Commit d4c3f36

Browse files
obnoxxxCopilottravisn
committed
build: make markdownlint targets self-contained
the markdownlint and markdownlint.fix make targets required markdownlint-cli2 to be installed locally in the $PATH. This change renders them self-contained by running markdownlint from the official markdownlint-cli2 docker image. Also clean the development-flow guide for linting tools Signed-off-by: Michael Adam <obnox@samba.org> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Travis Nielsen <tnielsen@redhat.com>
1 parent 9e15c6f commit d4c3f36

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Documentation/Contributing/development-flow.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ Run `make lint` to run all linters. This will require the following CLI tools to
255255
* [yamllint](https://www.yamllint.com/)
256256
* [shellcheck](https://www.shellcheck.net/)
257257
* [pylint](https://www.pylint.org/)
258-
* [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2)
259258

260259
Many of those tools are available via `brew` for MacOS or as Linux distribution packages.
261260
Otherwise refer to the respective project websites for installation instructions.

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ all: build
3232
CONTROLLER_GEN_VERSION=v0.19.0
3333
CT_VERSION := v3.13.0
3434
KUSTOMIZE_VERSION := v5.3.0
35+
MARKDOWNLINT_IMAGE_VERSION := v0.22.0
3536

3637
# include here and not earlier so that the version numbers are available
3738
# where needed
@@ -188,11 +189,11 @@ golangci-lint: $(YQ)
188189

189190
.PHONY: markdownlint
190191
markdownlint: ## Check formatting of documentation sources
191-
markdownlint-cli2 "Documentation/**/**.md" "#Documentation/Helm-Charts/**" --config .markdownlint-cli2.cjs
192+
@$(MARKDOWNLINT) "Documentation/**/**.md" "#Documentation/Helm-Charts/**" --config .markdownlint-cli2.cjs
192193

193194
.PHONY: markdownlint.fix
194195
markdownlint.fix: ## Check and fix formatting of documentation sources
195-
markdownlint-cli2 "Documentation/**/**.md" "#Documentation/Helm-Charts/**" --fix --config .markdownlint-cli2.cjs
196+
@$(MARKDOWNLINT) "Documentation/**/**.md" "#Documentation/Helm-Charts/**" --fix --config .markdownlint-cli2.cjs
196197

197198
.PHONY: yamllint
198199
yamllint:

build/makelib/common.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ DOCKERCMD=$(shell podman version >/dev/null 2>&1 && echo podman)
3535
endif
3636
endif
3737

38+
MARKDOWNLINT := $(DOCKERCMD) run --rm -v $$PWD:/workdir davidanson/markdownlint-cli2:$(MARKDOWNLINT_IMAGE_VERSION)
39+
3840
ifeq ($(origin PLATFORM), undefined)
3941
ifeq ($(origin GOOS), undefined)
4042
GOOS := $(shell go env GOOS)

0 commit comments

Comments
 (0)