Simplify Makefile and ci-checks (#2026)
This commit is contained in:
parent
924016dd1a
commit
40b22dc04e
27
Makefile
27
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 <!-- tocstop -->.
|
||||
#
|
||||
|
|
@ -48,7 +43,8 @@ install-markdown-toc:
|
|||
# <!-- Re-generate TOC with `make markdown-toc` -->
|
||||
# <!-- toc -->
|
||||
# <!-- tocstop -->
|
||||
markdown-toc:
|
||||
.PHONY: markdown-toc
|
||||
markdown-toc: $(MARKDOWN_TOC)
|
||||
@for f in $(ALL_DOCS); do \
|
||||
if grep -q '<!-- tocstop -->' $$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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue