Skip to content

Commit 48186eb

Browse files
Fix spelling and boilerplate errors
Some spelling and boilerplate errors are fixed which caused the failing of these tests.
1 parent 71690af commit 48186eb

7 files changed

+49
-13
lines changed

.prow.sh

+16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
#! /bin/bash -e
2+
3+
# Copyright 2021 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
28
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
317
# This is for testing csi-release-tools itself in Prow. All other
418
# repos use prow.sh for that, but as csi-release-tools isn't a normal
519
# repo with some Go code in it, it has a custom Prow test script.
620

721
./verify-shellcheck.sh "$(pwd)"
22+
./verify-spelling.sh "$(pwd)"
23+
./verify-boilerplate.sh "$(pwd)"

SIDECAR_RELEASE_PROCESS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The release manager must:
1111
kubernetes/org to request membership
1212
* Be a top level approver for the repository. To become a top level approver,
1313
the candidate must demonstrate ownership and deep knowledge of the repository
14-
through active maintainence, responding to and fixing issues, reviewing PRs,
14+
through active maintenance, responding to and fixing issues, reviewing PRs,
1515
test triage.
1616
* Be part of the maintainers or admin group for the repository. admin is a
1717
superset of maintainers, only maintainers level is required for cutting a

cloudbuild.sh

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
#! /bin/bash
22

3+
# Copyright 2021 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
317
# shellcheck disable=SC1091
418
. release-tools/prow.sh
519

prow.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/bash
2-
#
2+
33
# Copyright 2019 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64
7373
# which is disabled with GOFLAGS=-mod=vendor).
7474
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"
7575

76-
# Go versions can be specified seperately for different tasks
76+
# Go versions can be specified separately for different tasks
7777
# If the pre-installed Go is missing or a different
7878
# version, the required version here will get installed
7979
# from https://golang.org/dl/.
@@ -293,7 +293,7 @@ configvar CSI_PROW_E2E_FOCUS_LATEST '\[Feature:VolumeSnapshotDataSource\]' "non-
293293
configvar CSI_PROW_E2E_FOCUS "$(get_versioned_variable CSI_PROW_E2E_FOCUS "${csi_prow_kubernetes_version_suffix}")" "non-alpha, feature-tagged tests"
294294

295295
# Serial vs. parallel is always determined by these regular expressions.
296-
# Individual regular expressions are seperated by spaces for readability
296+
# Individual regular expressions are separated by spaces for readability
297297
# and expected to not contain spaces. Use dots instead. The complete
298298
# regex for Ginkgo will be created by joining the individual terms.
299299
configvar CSI_PROW_E2E_SERIAL '\[Serial\] \[Disruptive\]' "tags for serial E2E tests"
@@ -998,7 +998,7 @@ make_test_to_junit () {
998998
echo "$line" # pass through
999999
if echo "$line" | grep -q "^### [^ ]*:$"; then
10001000
if [ "$testname" ]; then
1001-
# previous test succesful
1001+
# previous test successful
10021002
echo " </system-out>" >>"$out"
10031003
echo " </testcase>" >>"$out"
10041004
fi

verify-boilerplate.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ if [[ -z "$(command -v python)" ]]; then
2525
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
2626
fi
2727

28-
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")
28+
# The csi-release-tools directory.
29+
TOOLS="$(dirname "${BASH_SOURCE[0]}")"
2930

30-
boilerDir="${REPO_ROOT}/boilerplate"
31+
# Directory to check. Default is the parent of the tools themselves.
32+
ROOT="${1:-${TOOLS}/..}"
33+
34+
boilerDir="${ROOT}/boilerplate"
3135
boiler="${boilerDir}/boilerplate.py"
3236

33-
files_need_boilerplate=("$("${boiler}" --rootdir="${REPO_ROOT}" --verbose)")
37+
mapfile -t files_need_boilerplate < <("${boiler}" --rootdir="${ROOT}" --verbose)
3438

3539
# Run boilerplate.py unit tests
3640
unitTestOut="$(mktemp)"

verify-spelling.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ set -o pipefail
2020

2121
TOOL_VERSION="v0.3.4"
2222

23-
# cd to the root path
24-
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
25-
cd "${ROOT}"
23+
# The csi-release-tools directory.
24+
TOOLS="$(dirname "${BASH_SOURCE[0]}")"
25+
26+
# Directory to check. Default is the parent of the tools themselves.
27+
ROOT="${1:-${TOOLS}/..}"
2628

2729
# create a temporary directory
2830
TMP_DIR=$(mktemp -d)
@@ -42,12 +44,12 @@ if [[ -z "$(command -v misspell)" ]]; then
4244
GO111MODULE=on GOBIN="${TMP_DIR}" go get "github.com/client9/misspell/cmd/misspell@${TOOL_VERSION}"
4345
export PATH="${TMP_DIR}:${PATH}"
4446
fi
45-
cd "${ROOT}"
4647

4748
# check spelling
4849
RES=0
4950
echo "Checking spelling..."
5051
ERROR_LOG="${TMP_DIR}/errors.log"
52+
cd "${ROOT}"
5153
git ls-files | grep -v vendor | xargs misspell > "${ERROR_LOG}"
5254
if [[ -s "${ERROR_LOG}" ]]; then
5355
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status

verify-subtree.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh -e
2-
#
2+
33
# Copyright 2019 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)