Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.

Commit 23dbca2

Browse files
log errors on verify failure
Signed-off-by: Ashish Amarnath <[email protected]>
1 parent 13632bd commit 23dbca2

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

hack/verify-all.sh

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,53 @@ set -o pipefail
2121
source "$(dirname "$0")/utils.sh"
2222

2323
# set REPO_PATH
24-
REPO_PATH=$(get_root_path)
24+
readonly REPO_PATH=$(get_root_path)
2525
cd "${REPO_PATH}"
2626

27+
failure() {
28+
if [[ "${1}" != 0 ]]; then
29+
res=1
30+
echo "${2} failed"
31+
fi
32+
}
33+
2734
# exit code, if a script fails we'll set this to 1
2835
res=0
2936

3037
# run all verify scripts, optionally skipping any of them
3138

3239
if [[ "${VERIFY_WHITESPACE:-true}" == "true" ]]; then
3340
echo "[*] Verifying whitespace..."
34-
hack/verify-whitespace.sh || res=1
41+
hack/verify-whitespace.sh
42+
failure $? "verify-whitespace.sh"
3543
cd "${REPO_PATH}"
3644
fi
3745

3846
if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then
3947
echo "[*] Verifying spelling..."
40-
hack/verify-spelling.sh || res=1
48+
hack/verify-spelling.sh
49+
failure $? "verify-spelling.sh"
4150
cd "${REPO_PATH}"
4251
fi
4352

4453
if [[ "${VERIFY_BOILERPLATE:-true}" == "true" ]]; then
4554
echo "[*] Verifying boilerplate..."
46-
hack/verify-boilerplate.sh || res=1
55+
hack/verify-boilerplate.sh
56+
failure $? "verify-boilerplate.sh"
4757
cd "${REPO_PATH}"
4858
fi
4959

5060
if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then
5161
echo "[*] Verifying gofmt..."
52-
hack/verify-gofmt.sh || res=1
62+
hack/verify-gofmt.sh
63+
failure $? "verify-gofmt.sh"
5364
cd "${REPO_PATH}"
5465
fi
5566

5667
if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then
5768
echo "[*] Verifying golint..."
58-
hack/verify-golint.sh || res=1
69+
hack/verify-golint.sh
70+
failure $? "verify-golint.sh"
5971
cd "${REPO_PATH}"
6072
fi
6173

@@ -67,25 +79,29 @@ fi
6779

6880
if [[ "${VERIFY_DEPS:-true}" == "true" ]]; then
6981
echo "[*] Verifying deps..."
70-
hack/verify-deps.sh || res=1
82+
hack/verify-deps.sh
83+
failure $? "verify-deps.sh"
7184
cd "${REPO_PATH}"
7285
fi
7386

7487
if [[ "${VERIFY_GOTEST:-true}" == "true" ]]; then
7588
echo "[*] Verifying gotest..."
76-
hack/verify-gotest.sh || res=1
89+
hack/verify-gotest.sh
90+
failure $? "verify-gotest.sh"
7791
cd "${REPO_PATH}"
7892
fi
7993

8094
if [[ "${VERIFY_BUILD:-true}" == "true" ]]; then
8195
echo "[*] Verifying build..."
82-
hack/verify-build.sh || res=1
96+
hack/verify-build.sh
97+
failure $? "verify-build.sh"
8398
cd "${REPO_PATH}"
8499
fi
85100

86101
if [[ "${VERIFY_DOCKER_BUILD:-true}" == "true" ]]; then
87102
echo "[*] Verifying capd-manager docker image build..."
88-
hack/verify-docker-build.sh || res=1
103+
hack/verify-docker-build.sh
104+
failure $? "verify-docker-build.sh"
89105
cd "${REPO_PATH}"
90106
fi
91107

0 commit comments

Comments
 (0)