Skip to content

Commit

Permalink
Check whether rstcheck and mdl are installed, and give hint on how to…
Browse files Browse the repository at this point in the history
… install them if they are not available.

Signed-off-by: Felix Fontein <felix@fontein.de>
  • Loading branch information
felixfontein committed Sep 20, 2023
1 parent 61c643b commit 131fe7a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ SYFT_VERSION ?= v0.87.0
GORELEASER := $(BIN_DIR)/goreleaser
GORELEASER_VERSION ?= v1.20.0

RSTCHECK := $(shell command -v rstcheck)
MARKDOWNLINT := $(shell command -v mdl)

export PATH := $(BIN_DIR):$(PATH)

.PHONY: all
Expand Down Expand Up @@ -52,12 +55,14 @@ checkdocs: checkrst checkmd
.PHONY: checkrst
RST_FILES=$(shell find . -name '*.rst' | grep -v /vendor/ | sort)
checkrst: $(RST_FILES)
rstcheck --report-level warning $^
@if [ "$(RSTCHECK)" == "" ]; then echo "Need rstcheck to lint RST files. Install rstcheck from your system package repository or from PyPI (https://pypi.org/project/rstcheck/)."; exit 1; fi
$(RSTCHECK) --report-level warning $^

.PHONY: checkmd
MD_FILES=$(shell find . -name '*.md' | grep -v /vendor/ | sort)
checkmd: $(MD_FILES)
mdl $^
@if [ "$(MARKDOWNLINT)" == "" ]; then echo "Need markdownlint to lint RST files. Install markdownlint from your system package repository or from https://github.com/markdownlint/markdownlint."; exit 1; fi
$(MARKDOWNLINT) $^

.PHONY: test
test: vendor
Expand Down

0 comments on commit 131fe7a

Please sign in to comment.