From 40b22dc04efd2810cc2182f6d3384c207e724ba5 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 20 Oct 2021 09:24:14 -0400 Subject: [PATCH] Simplify Makefile and ci-checks (#2026) --- Makefile | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index fe57073e1..cc763a938 100644 --- a/Makefile +++ b/Makefile @@ -13,32 +13,27 @@ MARKDOWN_TOC=./node_modules/.bin/markdown-toc # Keep links in semantic_conventions/README.md and .vscode/settings.json in sync! SEMCONVGEN_VERSION=0.7.0 -.PHONY: install-misspell -install-misspell: - # TODO: Check for existence before installing +$(MISSPELL): cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell .PHONY: misspell -misspell: +misspell: $(MISSPELL) $(MISSPELL) -error $(ALL_DOCS) .PHONY: misspell-correction -misspell-correction: +misspell-correction: $(MISSPELL) $(MISSPELL) -w $(ALL_DOCS) -.PHONY: install-markdown-link-check -install-markdown-link-check: +$(MARKDOWN_LINK_CHECK): npm install markdown-link-check .PHONY: markdown-link-check -markdown-link-check: +markdown-link-check: $(MARKDOWN_LINK_CHECK) @for f in $(ALL_DOCS); do $(MARKDOWN_LINK_CHECK) --quiet --config .markdown_link_check_config.json $$f; done -.PHONY: install-markdown-toc -install-markdown-toc: +$(MARKDOWN_TOC): npm install markdown-toc -.PHONY: markdown-toc # This target runs markdown-toc on all files that contain # a comment . # @@ -48,7 +43,8 @@ install-markdown-toc: # # # -markdown-toc: +.PHONY: markdown-toc +markdown-toc: $(MARKDOWN_TOC) @for f in $(ALL_DOCS); do \ if grep -q '' $$f; then \ echo markdown-toc: processing $$f; \ @@ -58,12 +54,11 @@ markdown-toc: fi; \ done -.PHONY: install-markdownlint -install-markdownlint: +$(MARKDOWN_LINT): npm install markdownlint-cli .PHONY: markdownlint -markdownlint: +markdownlint: $(MARKDOWN_LINT) @for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f || exit 1; done .PHONY: install-yamllint @@ -103,5 +98,5 @@ fix: table-generation misspell-correction # Attempt to install all the tools .PHONY: install-tools -install-tools: install-misspell install-markdownlint install-markdown-link-check install-markdown-toc +install-tools: $(MISSPELL) $(MARKDOWN_LINT) $(MARKDOWN_LINK_CHECK) $(MARKDOWN_TOC) @echo "All tools installed"