summaryrefslogtreecommitdiff
path: root/hack/verify-spelling.sh
diff options
context:
space:
mode:
authorDavid Hovey <david@hoveytech.com>2019-09-25 16:48:08 -0700
committerDavid Hovey <david@hoveytech.com>2019-09-25 16:48:08 -0700
commit72c7370548a65efcea9a9ba57c59cd10fa6e7530 (patch)
treef549d6eb1ea92ea3eb11c062c4aa5c485206c567 /hack/verify-spelling.sh
parent1250c9771e9a5f0cb6aab40e746612d5c5a670bb (diff)
parent0b070cdc882e6b8f38aae95fcf4c18a983a61f36 (diff)
Merge branch 'master' of github.com:kubernetes/community
Diffstat (limited to 'hack/verify-spelling.sh')
-rwxr-xr-xhack/verify-spelling.sh16
1 files changed, 6 insertions, 10 deletions
diff --git a/hack/verify-spelling.sh b/hack/verify-spelling.sh
index 1831f8ba..f615a323 100755
--- a/hack/verify-spelling.sh
+++ b/hack/verify-spelling.sh
@@ -19,19 +19,15 @@ set -o nounset
set -o pipefail
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
+export GO111MODULE=on
+export GOPROXY="${GOPROXY:-https://proxy.golang.org}"
-# Install tools we need, but only from vendor/...
-cd ${KUBE_ROOT}
-go install ./vendor/github.com/client9/misspell/cmd/misspell
-if ! which misspell >/dev/null 2>&1; then
- echo "Can't find misspell - is your GOPATH 'bin' in your PATH?" >&2
- echo " GOPATH: ${GOPATH}" >&2
- echo " PATH: ${PATH}" >&2
- exit 1
-fi
+# Pick out version of misspell from go.mod
+go mod download
+misspell="$(go list -m -f '{{.Dir}}' github.com/client9/misspell)"
# Spell checking
# All the skipping files are defined in hack/.spelling_failures
skipping_file="${KUBE_ROOT}/hack/.spelling_failures"
failing_packages=$(echo `cat ${skipping_file}` | sed "s| | -e |g")
-git ls-files | grep -v -e ${failing_packages} | xargs misspell -i "" -error -o stderr
+git ls-files | grep -v -e ${failing_packages} | xargs go run "${misspell}/cmd/misspell" -i "" -error -o stderr