From 48186eba9e35109d665550c7aaff6375585d0ff6 Mon Sep 17 00:00:00 2001 From: Sachin Kumar Singh Date: Thu, 7 Jan 2021 17:13:45 +0530 Subject: [PATCH] Fix spelling and boilerplate errors Some spelling and boilerplate errors are fixed which caused the failing of these tests. --- .prow.sh | 16 ++++++++++++++++ SIDECAR_RELEASE_PROCESS.md | 2 +- cloudbuild.sh | 14 ++++++++++++++ prow.sh | 8 ++++---- verify-boilerplate.sh | 10 +++++++--- verify-spelling.sh | 10 ++++++---- verify-subtree.sh | 2 +- 7 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.prow.sh b/.prow.sh index b18c5358..b9267829 100755 --- a/.prow.sh +++ b/.prow.sh @@ -1,7 +1,23 @@ #! /bin/bash -e + +# Copyright 2021 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. + # This is for testing csi-release-tools itself in Prow. All other # repos use prow.sh for that, but as csi-release-tools isn't a normal # repo with some Go code in it, it has a custom Prow test script. ./verify-shellcheck.sh "$(pwd)" +./verify-spelling.sh "$(pwd)" +./verify-boilerplate.sh "$(pwd)" diff --git a/SIDECAR_RELEASE_PROCESS.md b/SIDECAR_RELEASE_PROCESS.md index 4575eb81..3aee7a81 100644 --- a/SIDECAR_RELEASE_PROCESS.md +++ b/SIDECAR_RELEASE_PROCESS.md @@ -11,7 +11,7 @@ The release manager must: kubernetes/org to request membership * Be a top level approver for the repository. To become a top level approver, the candidate must demonstrate ownership and deep knowledge of the repository - through active maintainence, responding to and fixing issues, reviewing PRs, + through active maintenance, responding to and fixing issues, reviewing PRs, test triage. * Be part of the maintainers or admin group for the repository. admin is a superset of maintainers, only maintainers level is required for cutting a diff --git a/cloudbuild.sh b/cloudbuild.sh index 3ba11eca..1edda4d3 100755 --- a/cloudbuild.sh +++ b/cloudbuild.sh @@ -1,5 +1,19 @@ #! /bin/bash +# Copyright 2021 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. + # shellcheck disable=SC1091 . release-tools/prow.sh diff --git a/prow.sh b/prow.sh index 161f347f..43136405 100755 --- a/prow.sh +++ b/prow.sh @@ -1,5 +1,5 @@ #! /bin/bash -# + # Copyright 2019 The Kubernetes Authors. # # 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 # which is disabled with GOFLAGS=-mod=vendor). configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory" -# Go versions can be specified seperately for different tasks +# Go versions can be specified separately for different tasks # If the pre-installed Go is missing or a different # version, the required version here will get installed # from https://golang.org/dl/. @@ -293,7 +293,7 @@ configvar CSI_PROW_E2E_FOCUS_LATEST '\[Feature:VolumeSnapshotDataSource\]' "non- configvar CSI_PROW_E2E_FOCUS "$(get_versioned_variable CSI_PROW_E2E_FOCUS "${csi_prow_kubernetes_version_suffix}")" "non-alpha, feature-tagged tests" # Serial vs. parallel is always determined by these regular expressions. -# Individual regular expressions are seperated by spaces for readability +# Individual regular expressions are separated by spaces for readability # and expected to not contain spaces. Use dots instead. The complete # regex for Ginkgo will be created by joining the individual terms. configvar CSI_PROW_E2E_SERIAL '\[Serial\] \[Disruptive\]' "tags for serial E2E tests" @@ -998,7 +998,7 @@ make_test_to_junit () { echo "$line" # pass through if echo "$line" | grep -q "^### [^ ]*:$"; then if [ "$testname" ]; then - # previous test succesful + # previous test successful echo " " >>"$out" echo " " >>"$out" fi diff --git a/verify-boilerplate.sh b/verify-boilerplate.sh index ff376e54..274a16d2 100755 --- a/verify-boilerplate.sh +++ b/verify-boilerplate.sh @@ -25,12 +25,16 @@ if [[ -z "$(command -v python)" ]]; then update-alternatives --install /usr/bin/python python /usr/bin/python3 1 fi -REPO_ROOT=$(dirname "${BASH_SOURCE[0]}") +# The csi-release-tools directory. +TOOLS="$(dirname "${BASH_SOURCE[0]}")" -boilerDir="${REPO_ROOT}/boilerplate" +# Directory to check. Default is the parent of the tools themselves. +ROOT="${1:-${TOOLS}/..}" + +boilerDir="${ROOT}/boilerplate" boiler="${boilerDir}/boilerplate.py" -files_need_boilerplate=("$("${boiler}" --rootdir="${REPO_ROOT}" --verbose)") +mapfile -t files_need_boilerplate < <("${boiler}" --rootdir="${ROOT}" --verbose) # Run boilerplate.py unit tests unitTestOut="$(mktemp)" diff --git a/verify-spelling.sh b/verify-spelling.sh index 9a41c931..38edb998 100755 --- a/verify-spelling.sh +++ b/verify-spelling.sh @@ -20,9 +20,11 @@ set -o pipefail TOOL_VERSION="v0.3.4" -# cd to the root path -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" -cd "${ROOT}" +# The csi-release-tools directory. +TOOLS="$(dirname "${BASH_SOURCE[0]}")" + +# Directory to check. Default is the parent of the tools themselves. +ROOT="${1:-${TOOLS}/..}" # create a temporary directory TMP_DIR=$(mktemp -d) @@ -42,12 +44,12 @@ if [[ -z "$(command -v misspell)" ]]; then GO111MODULE=on GOBIN="${TMP_DIR}" go get "github.com/client9/misspell/cmd/misspell@${TOOL_VERSION}" export PATH="${TMP_DIR}:${PATH}" fi -cd "${ROOT}" # check spelling RES=0 echo "Checking spelling..." ERROR_LOG="${TMP_DIR}/errors.log" +cd "${ROOT}" git ls-files | grep -v vendor | xargs misspell > "${ERROR_LOG}" if [[ -s "${ERROR_LOG}" ]]; then sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status diff --git a/verify-subtree.sh b/verify-subtree.sh index f04a9fa2..aa72194a 100755 --- a/verify-subtree.sh +++ b/verify-subtree.sh @@ -1,5 +1,5 @@ #! /bin/sh -e -# + # Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License");