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

Commit

Permalink
Merge pull request #142 from islinwb/add_spelling_check
Browse files Browse the repository at this point in the history
Add spelling check script and fix typos
  • Loading branch information
k8s-ci-robot authored Oct 24, 2018
2 parents 4f74ea0 + fe61002 commit fc489bf
Show file tree
Hide file tree
Showing 36 changed files with 34,138 additions and 21 deletions.
13 changes: 13 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
required = [
"github.com/onsi/ginkgo/ginkgo",
"github.com/docker/distribution",
"github.com/client9/misspell",
"github.com/client9/misspell/cmd/misspell",
]

[[constraint]]
Expand Down
2 changes: 1 addition & 1 deletion build/copy-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Copies any built binaries (and other generated files) out of the Docker build contianer.
# Copies any built binaries (and other generated files) out of the Docker build container.
set -o errexit
set -o nounset
set -o pipefail
Expand Down
4 changes: 4 additions & 0 deletions hack/.spelling_failures
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BUILD
OWNERS
third_party/
vendor/
2 changes: 1 addition & 1 deletion hack/make-rules/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function run-cmd {
return ${tr}
}

# Collect Failed tests in this Array , initalize it to nil
# Collect Failed tests in this Array , initialize it to nil
FAILED_TESTS=()

function print-failed-tests {
Expand Down
2 changes: 1 addition & 1 deletion hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ kube::version::get_version_vars

# This is to prevent the script from starting if its on a dirty commit.
if [[ "${KUBE_GIT_VERSION}" != "${RELEASE_TAG}" ]]; then
echo "Version being build: ${KUBE_GIT_VERSION} does not match the release version: ${RELEASE_TAG}, there probably is uncommited work."
echo "Version being build: ${KUBE_GIT_VERSION} does not match the release version: ${RELEASE_TAG}, there probably is uncommitted work."
exit 1
else
echo "Using ${RELEASE_TAG} for release push"
Expand Down
34 changes: 34 additions & 0 deletions hack/verify-spelling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/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, but only from vendor/...
go install github.com/kubernetes-sigs/poseidon/vendor/github.com/client9/misspell/cmd/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 "Creater,creater,ect" -error -o stderr
6 changes: 3 additions & 3 deletions pkg/k8sclient/nodewatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func TestNodeWatcher_enqueueNodeAddition(t *testing.T) {
defer testObj.mockCtrl.Finish()

nodeWatch := NewNodeWatcher(testObj.kubeClient, testObj.firmamentClient)
keychan := make(chan interface{})
keychain := make(chan interface{})
itemschan := make(chan []interface{})

for _, testValue := range testData {
Expand All @@ -279,13 +279,13 @@ func TestNodeWatcher_enqueueNodeAddition(t *testing.T) {
nodeWatch.enqueueNodeAddition(key, testValue.node)
go func() {
newkey, newitems, _ := nodeWatch.nodeWorkQueue.Get()
keychan <- newkey
keychain <- newkey
itemschan <- newitems
}()
waitTimer := time.NewTimer(time.Second * 5)
select {
case <-waitTimer.C:
case newkey := <-keychan:
case newkey := <-keychain:
newitem := <-itemschan

for _, item := range newitem {
Expand Down
2 changes: 1 addition & 1 deletion pkg/k8sclient/podwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func (pw *PodWatcher) podWorker() {
PodMux.Lock()

// check if the pod already exists
// this cases happend when Replicaset are used.
// this cases happened when Replicaset are used.
// When a replicaset is delete it creates more pods with the same name
_, ok := PodToTD[pod.Identifier]
if ok {
Expand Down
6 changes: 3 additions & 3 deletions pkg/k8sclient/podwatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestNewPodWatcher(t *testing.T) {
func TestPodWatcher_enqueuePodAddition(t *testing.T) {
var empty map[string]string
fakeNow := metav1.Now()
keychan := make(chan interface{})
keychain := make(chan interface{})
itemschan := make(chan []interface{})
fakeOwnerRef := "abcdfe12345"

Expand Down Expand Up @@ -511,13 +511,13 @@ func TestPodWatcher_enqueuePodAddition(t *testing.T) {
podWatch.enqueuePodAddition(key, podData.pod)
go func() {
newkey, newitems, _ := podWatch.podWorkQueue.Get()
keychan <- newkey
keychain <- newkey
itemschan <- newitems
}()
waitTimer := time.NewTimer(time.Second * 2)
select {
case <-waitTimer.C:
case newkey := <-keychan:
case newkey := <-keychain:
newitems := <-itemschan
for _, item := range newitems {
if newItem, ok := item.(*Pod); ok {
Expand Down
4 changes: 2 additions & 2 deletions pkg/stats/poseidonstats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ syntax = "proto3";

package stats;

// PoseidonStats is a service that is responsbile for receiving node and pod stats.
// PoseidonStats is a service that is responsible for receiving node and pod stats.
service PoseidonStats {
rpc ReceiveNodeStats(stream NodeStats) returns (stream NodeStatsResponse) {}
rpc ReceivePodStats(stream PodStats) returns (stream PodStatsResponse) {}
Expand Down Expand Up @@ -96,4 +96,4 @@ message PodStatsResponse {
PodStatsResponseType type = 1;
string name = 2;
string namespace = 3;
}
}
18 changes: 9 additions & 9 deletions test/e2e/poseidon_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 1 {
Skip(fmt.Sprintf("Skipping this test case as the required minimum nodes not avaliable "))
Skip(fmt.Sprintf("Skipping this test case as the required minimum nodes not available "))
}
nodeOne := schedulableNodes[0]

Expand Down Expand Up @@ -679,7 +679,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 1 {
Skip(fmt.Sprintf("Skipping this test case as the required minimum nodes not avaliable "))
Skip(fmt.Sprintf("Skipping this test case as the required minimum nodes not available "))
}
nodeOne := schedulableNodes[0]

Expand Down Expand Up @@ -777,7 +777,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -890,7 +890,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 3 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of three node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of three node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -992,7 +992,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of three node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of three node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -1840,7 +1840,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -1896,7 +1896,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -1950,7 +1950,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down Expand Up @@ -2011,7 +2011,7 @@ var _ = Describe("Poseidon", func() {
By("Trying to get a schedulable node")
schedulableNodes := framework.ListSchedulableNodes(clientset)
if len(schedulableNodes) < 2 {
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes avaliable", len(schedulableNodes)))
Skip(fmt.Sprintf("Skipping this test case as this requires minimum of two node and only %d nodes available", len(schedulableNodes)))
}
nodeOne = schedulableNodes[0]
nodeTwo = schedulableNodes[1]
Expand Down
34 changes: 34 additions & 0 deletions vendor/github.com/client9/misspell/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/client9/misspell/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions vendor/github.com/client9/misspell/BUILD

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions vendor/github.com/client9/misspell/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions vendor/github.com/client9/misspell/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fc489bf

Please sign in to comment.