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

Commit 7a638d0

Browse files
authored
Merge pull request #36 from chuckha/verify
only print failed verfiy outputs
2 parents 92be40d + 8d38b0d commit 7a638d0

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

hack/verify-all.sh

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,75 +26,78 @@ cd "${REPO_PATH}"
2626
failure() {
2727
if [[ "${1}" = 1 ]]; then
2828
res=1
29-
echo "${2} failed"
29+
failed+=("${2}")
30+
outputs+=("${3}")
3031
fi
3132
}
3233

3334
# exit code, if a script fails we'll set this to 1
3435
res=0
36+
failed=()
37+
outputs=()
3538

3639
# run all verify scripts, optionally skipping any of them
3740

3841
if [[ "${VERIFY_WHITESPACE:-true}" == "true" ]]; then
3942
echo "[*] Verifying whitespace..."
40-
hack/verify-whitespace.sh
41-
failure $? "verify-whitespace.sh"
43+
out=$(hack/verify-whitespace.sh 2>&1)
44+
failure $? "verify-whitespace.sh" "${out}"
4245
cd "${REPO_PATH}"
4346
fi
4447

4548
if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then
4649
echo "[*] Verifying spelling..."
47-
hack/verify-spelling.sh
48-
failure $? "verify-spelling.sh"
50+
out=$(hack/verify-spelling.sh 2>&1)
51+
failure $? "verify-spelling.sh" "${out}"
4952
cd "${REPO_PATH}"
5053
fi
5154

5255
if [[ "${VERIFY_BOILERPLATE:-true}" == "true" ]]; then
5356
echo "[*] Verifying boilerplate..."
54-
hack/verify-boilerplate.sh
55-
failure $? "verify-boilerplate.sh"
57+
out=$(hack/verify-boilerplate.sh 2>&1)
58+
failure $? "verify-boilerplate.sh" "${out}"
5659
cd "${REPO_PATH}"
5760
fi
5861

5962
if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then
6063
echo "[*] Verifying gofmt..."
61-
hack/verify-gofmt.sh
62-
failure $? "verify-gofmt.sh"
64+
out=$(hack/verify-gofmt.sh 2>&1)
65+
failure $? "verify-gofmt.sh" "${out}"
6366
cd "${REPO_PATH}"
6467
fi
6568

6669
if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then
6770
echo "[*] Verifying golint..."
68-
hack/verify-golint.sh
69-
failure $? "verify-golint.sh"
71+
out=$(hack/verify-golint.sh 2>&1)
72+
failure $? "verify-golint.sh" "${out}"
7073
cd "${REPO_PATH}"
7174
fi
7275

7376
if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then
7477
echo "[*] Verifying govet..."
75-
hack/verify-govet.sh
76-
failure $? "verify-govet.sh"
78+
out=$(hack/verify-govet.sh 2>&1)
79+
failure $? "verify-govet.sh" "${out}"
7780
cd "${REPO_PATH}"
7881
fi
7982

8083
if [[ "${VERIFY_DEPS:-true}" == "true" ]]; then
8184
echo "[*] Verifying deps..."
82-
hack/verify-deps.sh
83-
failure $? "verify-deps.sh"
85+
out=$(hack/verify-deps.sh 2>&1)
86+
failure $? "verify-deps.sh" "${out}"
8487
cd "${REPO_PATH}"
8588
fi
8689

8790
if [[ "${VERIFY_GOTEST:-true}" == "true" ]]; then
8891
echo "[*] Verifying gotest..."
89-
hack/verify-gotest.sh
90-
failure $? "verify-gotest.sh"
92+
out=$(hack/verify-gotest.sh 2>&1)
93+
failure $? "verify-gotest.sh" "${out}"
9194
cd "${REPO_PATH}"
9295
fi
9396

9497
if [[ "${VERIFY_BUILD:-true}" == "true" ]]; then
9598
echo "[*] Verifying build..."
96-
hack/verify-build.sh
97-
failure $? "verify-build.sh"
99+
out=$(hack/verify-build.sh 2>&1)
100+
failure $? "verify-build.sh" "${out}"
98101
cd "${REPO_PATH}"
99102
fi
100103

@@ -104,6 +107,11 @@ if [[ "${res}" = 0 ]]; then
104107
echo "All verify checks passed, congrats!"
105108
else
106109
echo ""
107-
echo "One or more verify checks failed! See output above..."
110+
echo "Some of the verify scripts failed:"
111+
for i in "${!failed[@]}"; do
112+
echo "- ${failed[$i]}:"
113+
echo "${outputs[$i]}"
114+
echo
115+
done
108116
fi
109117
exit "${res}"

0 commit comments

Comments
 (0)