From f9167c82ecaf11ed038f8dfd0a8b64c4a01ffa01 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Thu, 19 Oct 2023 10:04:42 -0400 Subject: [PATCH] Add check and check-VERSION targets The targets allow the checks to be run for each version (`make check`), or for a given version (`make check-2.13`). Multiple checks can be run in parallel with `make check -j$(nproc)` The pass message output of the check script has been updated to include the input filename in order to make it clearer which file succeeds when running checks in parallel. Change-Id: Ia7aceb97dc35f54ffa791daa285d8bce2dd31ca9 --- Makefile | 10 ++++++++++ tools/check.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0271a0d..26b0b6b 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ CONF = asciidoc.html5.conf PREFIX = lttng-docs ALLVERSIONS = $(sort $(wildcard 2.*)) +ALLCHECK = $(foreach v, $(ALLVERSIONS), check-$(v)) ASCIIDOC = asciidoc -v -f $(CONF) -a source-highlighter=pygments RM = rm -rf @@ -19,6 +20,11 @@ view-$(1): xdg-open $(1)/$(PREFIX)-$(1).html .PHONY: view-$(1) + +check-$(1): $(1)/$(PREFIX)-$(1).txt $(CONF) + python3 tools/check.py $(1)/$(PREFIX)-$(1).txt + +.PHONY: check-$(1) endef .PHONY: all @@ -27,6 +33,10 @@ all: $(ALLVERSIONS) $(foreach v,$(ALLVERSIONS),$(eval $(call vrule,$(v)))) +.PHONY: check + +check: $(ALLCHECK) + .PHONY: clean clean: diff --git a/tools/check.py b/tools/check.py index 70bd8d5..0fe2719 100644 --- a/tools/check.py +++ b/tools/check.py @@ -169,7 +169,7 @@ def _main(): if checker.has_error: return 1 - print(colored('All good!', 'green', attrs=['bold'])) + print(colored('{}: All good!'.format(args.infile), 'green', attrs=['bold'])) return 0 -- 2.34.1