From ad29307f7c85c2a1a4de5d9b7764fc8050be901b Mon Sep 17 00:00:00 2001 From: Sachin Kumar Singh Date: Fri, 15 Jan 2021 19:56:33 +0530 Subject: [PATCH] Make the spelling and boilerplate checks optional The boilerplate and spelling tests are made optional and the default paths in the relative scripts are made absolute. --- build.make | 6 ++---- verify-boilerplate.sh | 4 ++-- verify-spelling.sh | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build.make b/build.make index a405c6700..9b8306c06 100644 --- a/build.make +++ b/build.make @@ -278,15 +278,13 @@ check-go-version-%: # Test for spelling errors. .PHONY: test-spelling -test: test-spelling test-spelling: @ echo; echo "### $@:" - @ ./release-tools/verify-spelling.sh + @ ./release-tools/verify-spelling.sh "$(pwd)" # Test the boilerplates of the files. .PHONY: test-boilerplate -test: test-boilerplate test-boilerplate: @ echo; echo "### $@:" - @ ./release-tools/verify-boilerplate.sh + @ ./release-tools/verify-boilerplate.sh "$(pwd)" diff --git a/verify-boilerplate.sh b/verify-boilerplate.sh index 274a16d28..0781b0500 100755 --- a/verify-boilerplate.sh +++ b/verify-boilerplate.sh @@ -25,8 +25,8 @@ if [[ -z "$(command -v python)" ]]; then update-alternatives --install /usr/bin/python python /usr/bin/python3 1 fi -# The csi-release-tools directory. -TOOLS="$(dirname "${BASH_SOURCE[0]}")" +# The csi-release-tools directory (absolute path). +TOOLS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" # Directory to check. Default is the parent of the tools themselves. ROOT="${1:-${TOOLS}/..}" diff --git a/verify-spelling.sh b/verify-spelling.sh index 38edb9985..4aeb34d68 100755 --- a/verify-spelling.sh +++ b/verify-spelling.sh @@ -20,8 +20,8 @@ set -o pipefail TOOL_VERSION="v0.3.4" -# The csi-release-tools directory. -TOOLS="$(dirname "${BASH_SOURCE[0]}")" +# The csi-release-tools directory (absolute path). +TOOLS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" # Directory to check. Default is the parent of the tools themselves. ROOT="${1:-${TOOLS}/..}"