Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit 01f06b8

Browse files
committed
add spelling check script
1 parent baee1bb commit 01f06b8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

hack/.spelling_failures

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BUILD
2+
OWNERS
3+
third_party/
4+
vendor/

hack/verify-spelling.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2018 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
21+
source "${KUBE_ROOT}/hack/lib/init.sh"
22+
23+
# Ensure that we find the binaries we build before anything else.
24+
export GOBIN="${KUBE_OUTPUT_BINPATH}"
25+
PATH="${GOBIN}:${PATH}"
26+
27+
# Install tools we need, but only from vendor/...
28+
go install github.com/kubernetes-sigs/poseidon/vendor/github.com/client9/misspell/cmd/misspell
29+
30+
# Spell checking
31+
# All the skipping files are defined in hack/.spelling_failures
32+
skipping_file="${KUBE_ROOT}/hack/.spelling_failures"
33+
failing_packages=$(echo `cat ${skipping_file}` | sed "s| | -e |g")
34+
git ls-files | grep -v -e ${failing_packages} | xargs misspell -i "Creater,creater,ect" -error -o stderr

0 commit comments

Comments
 (0)