@@ -166,7 +166,7 @@ TOOL_SNIPDOC := $(HOME)/.local/bin/snipdoc
166166# npm bin -g will do this on later npms than we have
167167NVM_BIN ?= $(shell npm config get prefix) /bin
168168TOOL_CLANG_FORMAT := /usr/local/bin/clang-format
169- TOOL_MDSPELL := $( NVM_BIN ) /mdspell
169+ TOOL_CODESPELL := /usr/local/bin/codespell
170170TOOL_MARKDOWN_LINK_CHECK := $(NVM_BIN ) /markdown-link-check
171171TOOL_MARKDOWNLINT := $(NVM_BIN ) /markdownlint
172172TOOL_DEVCONTAINER := $(NVM_BIN ) /devcontainer
@@ -830,16 +830,27 @@ docs/cli/argo.md: $(CLI_PKG_FILES) go.sum ui/dist/app/index.html hack/docs/cli.g
830830docs/go-sdk-guide.md : $(TOOL_SNIPDOC )
831831 $(TOOL_SNIPDOC ) run
832832
833- $(TOOL_MDSPELL ) : Makefile
834833# update this in Nix when upgrading it here
835834ifneq ($(USE_NIX ) , true)
836835 npm list -g
[email protected] > /dev/null || npm i -g
[email protected] 837836endif
838837
838+ $(TOOL_CODESPELL ) : Makefile
839+
840+ $(TOOL_CODESPELL ) :
841+ ifeq (, $(shell which codespell) )
842+ ifeq ($(shell uname) ,Darwin)
843+ brew install codespell
844+ else
845+ sudo apt update
846+ sudo apt install -y codespell
847+ endif
848+ endif
849+
839850.PHONY : docs-spellcheck
840- docs-spellcheck : $(TOOL_MDSPELL ) docs/metrics.md # # Spell check docs
851+ docs-spellcheck : $(TOOL_CODESPELL ) docs/metrics.md # # Spell check docs
841852 # check docs for spelling mistakes
842- $(TOOL_MDSPELL ) --ignore-numbers --ignore-acronyms --en-us --no-suggestions --report $( shell find docs -name ' * .md' -not -name upgrading.md -not -name README.md -not -name fields.md -not -name workflow-controller-configmap.md -not -name upgrading.md -not -name executor_swagger.md -not -path ' * /cli/ * ' -not -name tested-kubernetes-versions .md -not -name new-features.md)
853+ $(TOOL_CODESPELL ) --quiet-level=2 --check-filenames --ignore-words=.codespell-ignore --check-hidden " docs/**/* .md"
843854 # alphabetize spelling file -- ignore first line (comment), then sort the rest case-sensitive and remove duplicates
844855 $(shell cat .spelling | awk 'NR<2{ print $0; next } { print $0 | "LC_COLLATE=C sort" }' | uniq > .spelling.tmp && mv .spelling.tmp .spelling)
845856
0 commit comments