diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 44918d01c..915639b61 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -244,7 +244,7 @@ go.imports: tools.verify.goimports ## go.verify: execute all verity scripts. .PHONY: go.verify -go.verify: +go.verify: tools.verify.misspell @echo "Starting verification..." @scripts_list=$$(find $(ROOT_DIR)/scripts -type f -name 'verify-*' | sort); \ for script in $$scripts_list; do \ diff --git a/scripts/make-rules/tools.mk b/scripts/make-rules/tools.mk index 5f076d6e7..5d39258ea 100644 --- a/scripts/make-rules/tools.mk +++ b/scripts/make-rules/tools.mk @@ -217,6 +217,11 @@ install.depth: install.go-callvis: @$(GO) install github.com/ofabry/go-callvis@latest +## install.misspell +.PHONY: install.misspell +install.misspell: + @$(GO) install github.com/client9/misspell/cmd/misspell@latest + ## install.gothanks: Install gothanks, used to thank go dependencies .PHONY: install.gothanks install.gothanks: diff --git a/scripts/verify-spelling.sh b/scripts/verify-spelling.sh index 684e7b14f..2c02dccf7 100755 --- a/scripts/verify-spelling.sh +++ b/scripts/verify-spelling.sh @@ -25,17 +25,8 @@ OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. export OPENIM_ROOT source "${OPENIM_ROOT}/scripts/lib/init.sh" -# Ensure that we find the binaries we build before anything else. -export GOBIN="${KUBE_OUTPUT_BINPATH}" -PATH="${GOBIN}:${PATH}" - -# Install tools we need -pushd "${OPENIM_ROOT}/tools" >/dev/null -GO111MODULE=on go install github.com/client9/misspell/cmd/misspell -popd >/dev/null - # Spell checking # All the skipping files are defined in scripts/.spelling_failures skipping_file="${OPENIM_ROOT}/scripts/.spelling_failures" failing_packages=$(sed "s| | -e |g" "${skipping_file}") -git ls-files | grep -v -e "${failing_packages}" | xargs misspell -i "Creater,creater,ect" -error -o stderr +git ls-files | grep -v -e "${failing_packages}" | xargs "$OPENIM_ROOT/_output/tools/misspell" -i "Creater,creater,ect" -error -o stderr