Skip to content

Commit 3eacfef

Browse files
committed
Remove verify-clientset, fix verify-doctoc
Signed-off-by: Vince Prignano <[email protected]>
1 parent 7356a99 commit 3eacfef

File tree

3 files changed

+7
-59
lines changed

3 files changed

+7
-59
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ clean-clientset: ## Remove all generated clientset files
198198
.PHONY: verify
199199
verify:
200200
./hack/verify-boilerplate.sh
201-
./hack/verify-clientset.sh
202201
./hack/verify-bazel.sh
203202
./hack/verify-doctoc.sh
204203

hack/verify-clientset.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

hack/verify-doctoc.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21+
command -v doctoc || echo "doctoc is not available on your system, skipping verification" && exit 0
22+
2123
doctoc_files="README.md \
2224
CONTRIBUTING.md \
2325
cmd/clusterctl/README.md \
@@ -33,24 +35,24 @@ function check_doctoc(){
3335
changed_files=""
3436
for file in $doctoc_files
3537
do
36-
res=$(git diff --cached $file)
38+
res=$(git diff --cached "$file")
3739
if [ "$res" ]
3840
then
3941
changed_files="$changed_files\n$file"
4042
fi
4143
done
4244

43-
if [ $changed_files ];then
45+
if [ "${changed_files}" ];then
4446
echo -e "Please update these files: $changed_files."
4547
echo "Update with doctoc FILENAME."
4648
echo "Re-commit with -n/--no-verify option."
47-
exit -1
49+
exit 1
4850
fi
4951

5052
}
5153

52-
doctoc $doctoc_files >/dev/null 2>&1
54+
doctoc "${doctoc_files}" >/dev/null 2>&1
5355
check=$(git diff)
54-
if [ ! -z "$check" ];then
56+
if [ -n "$check" ];then
5557
check_doctoc
5658
fi

0 commit comments

Comments
 (0)