From 8042e14b27120278cdf4ffd1d66447b439588857 Mon Sep 17 00:00:00 2001 From: Adrian Clay Lake Date: Tue, 23 Jul 2024 19:38:12 +0200 Subject: [PATCH] chore: update woke config (#642) * fix(docs/Makefile): fixed woke utility skipping .*ignore files * fix(docs/Makefile): woke now fails tests on non-compliance * fix(docs/Makefile): woke now only tests on canonical/Inclusive-naming config * fix(docs/Makefile): fixed inline comment typo * refactor(docs/Makefile): initial cd is more robust --------- Co-authored-by: Tiago Nobrega Co-authored-by: Cristovao Cordeiro --- docs/Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 26b66b43d..6d89621ed 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -10,6 +10,10 @@ BUILDDIR = _build VENV = env/bin/activate PORT = 8080 +# Locate this directory relative to the repository root. See woke recipe. +REPOROOT = $(shell git rev-parse --show-toplevel) +RELCWD = $(shell realpath --relative-to=$(REPOROOT) $(CURDIR)) + # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @@ -39,7 +43,14 @@ linkcheck: woke: type woke >/dev/null 2>&1 || { snap install woke; exit 1; } - woke *.rst **/*.rst -c https://github.com/canonical-web-and-design/Inclusive-naming/raw/main/config.yml + + # Woke appears to have an issue where it skips .*ignore files unless it is executed from the repo root. + # This is mitigated by changing to the repo root and running woke on the relative docs path. + # Tested on 19/07/24 with woke 0.19.0-4-g5d52c15 + cd $(REPOROOT); woke $(RELCWD)/**/*.rst $(RELCWD)/*.rst \ + -c https://github.com/canonical-web-and-design/Inclusive-naming/raw/main/config.yml \ + --disable-default-rules \ + --exit-1-on-failure .PHONY: help Makefile