From 51851edc180c198b14a323899f6b4c84814c3921 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 16 Sep 2023 22:38:17 +0200 Subject: [PATCH] Add checkdocs, checkrst, and checkmd make targets. Signed-off-by: Felix Fontein --- .github/workflows/docs.yml | 13 ++++++------- Makefile | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 14f11280e9..fc3916fe0c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,14 +25,13 @@ jobs: - name: Checkout code uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - name: Install rstcheck - run: pip install rstcheck + - name: Install rstcheck and markdownlint + run: | + pip install rstcheck + sudo gem install mdl - name: Run rstcheck on all RST files - run: rstcheck $(find -name '*.rst') - - - name: Install markdownlint - run: sudo gem install mdl + run: make checkrst - name: Run mdl on all MD files - run: mdl $(find -name '*.md') + run: make checkmd diff --git a/Makefile b/Makefile index a8e417941c..a28c24bb0c 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,20 @@ vendor: vet: $(GO) vet ./... + +.PHONY: checkdocs +checkdocs: checkrst checkmd + +.PHONY: checkrst +RST_FILES=$(shell find . -name '*.rst' | grep -v /vendor/ | sort) +checkrst: $(RST_FILES) + rstcheck $^ + +.PHONY: checkmd +MD_FILES=$(shell find . -name '*.md' | grep -v /vendor/ | sort) +checkmd: $(MD_FILES) + mdl $^ + .PHONY: test test: vendor gpg --import pgp/sops_functional_tests_key.asc 2>&1 1>/dev/null || exit 0