Simplify Makefile and ci-checks (#2026)

This commit is contained in:
Yuri Shkuro 2021-10-20 09:24:14 -04:00 committed by GitHub
parent 924016dd1a
commit 40b22dc04e
1 changed files with 11 additions and 16 deletions

View File

@ -13,32 +13,27 @@ MARKDOWN_TOC=./node_modules/.bin/markdown-toc
# Keep links in semantic_conventions/README.md and .vscode/settings.json in sync! # Keep links in semantic_conventions/README.md and .vscode/settings.json in sync!
SEMCONVGEN_VERSION=0.7.0 SEMCONVGEN_VERSION=0.7.0
.PHONY: install-misspell $(MISSPELL):
install-misspell:
# TODO: Check for existence before installing
cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell
.PHONY: misspell .PHONY: misspell
misspell: misspell: $(MISSPELL)
$(MISSPELL) -error $(ALL_DOCS) $(MISSPELL) -error $(ALL_DOCS)
.PHONY: misspell-correction .PHONY: misspell-correction
misspell-correction: misspell-correction: $(MISSPELL)
$(MISSPELL) -w $(ALL_DOCS) $(MISSPELL) -w $(ALL_DOCS)
.PHONY: install-markdown-link-check $(MARKDOWN_LINK_CHECK):
install-markdown-link-check:
npm install markdown-link-check npm install markdown-link-check
.PHONY: 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 @for f in $(ALL_DOCS); do $(MARKDOWN_LINK_CHECK) --quiet --config .markdown_link_check_config.json $$f; done
.PHONY: install-markdown-toc $(MARKDOWN_TOC):
install-markdown-toc:
npm install markdown-toc npm install markdown-toc
.PHONY: markdown-toc
# This target runs markdown-toc on all files that contain # This target runs markdown-toc on all files that contain
# a comment <!-- tocstop -->. # a comment <!-- tocstop -->.
# #
@ -48,7 +43,8 @@ install-markdown-toc:
# <!-- Re-generate TOC with `make markdown-toc` --> # <!-- Re-generate TOC with `make markdown-toc` -->
# <!-- toc --> # <!-- toc -->
# <!-- tocstop --> # <!-- tocstop -->
markdown-toc: .PHONY: markdown-toc
markdown-toc: $(MARKDOWN_TOC)
@for f in $(ALL_DOCS); do \ @for f in $(ALL_DOCS); do \
if grep -q '<!-- tocstop -->' $$f; then \ if grep -q '<!-- tocstop -->' $$f; then \
echo markdown-toc: processing $$f; \ echo markdown-toc: processing $$f; \
@ -58,12 +54,11 @@ markdown-toc:
fi; \ fi; \
done done
.PHONY: install-markdownlint $(MARKDOWN_LINT):
install-markdownlint:
npm install markdownlint-cli npm install markdownlint-cli
.PHONY: markdownlint .PHONY: markdownlint
markdownlint: markdownlint: $(MARKDOWN_LINT)
@for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f || exit 1; done @for f in $(ALL_DOCS); do echo $$f; $(MARKDOWN_LINT) -c .markdownlint.yaml $$f || exit 1; done
.PHONY: install-yamllint .PHONY: install-yamllint
@ -103,5 +98,5 @@ fix: table-generation misspell-correction
# Attempt to install all the tools # Attempt to install all the tools
.PHONY: install-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" @echo "All tools installed"