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

only print failed verfiy outputs #36

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 28 additions & 20 deletions hack/verify-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,75 +26,78 @@ cd "${REPO_PATH}"
failure() {
if [[ "${1}" = 1 ]]; then
res=1
echo "${2} failed"
failed+=("${2}")
outputs+=("${3}")
fi
}

# exit code, if a script fails we'll set this to 1
res=0
failed=()
outputs=()

# run all verify scripts, optionally skipping any of them

if [[ "${VERIFY_WHITESPACE:-true}" == "true" ]]; then
echo "[*] Verifying whitespace..."
hack/verify-whitespace.sh
failure $? "verify-whitespace.sh"
out=$(hack/verify-whitespace.sh 2>&1)
failure $? "verify-whitespace.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_SPELLING:-true}" == "true" ]]; then
echo "[*] Verifying spelling..."
hack/verify-spelling.sh
failure $? "verify-spelling.sh"
out=$(hack/verify-spelling.sh 2>&1)
failure $? "verify-spelling.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_BOILERPLATE:-true}" == "true" ]]; then
echo "[*] Verifying boilerplate..."
hack/verify-boilerplate.sh
failure $? "verify-boilerplate.sh"
out=$(hack/verify-boilerplate.sh 2>&1)
failure $? "verify-boilerplate.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_GOFMT:-true}" == "true" ]]; then
echo "[*] Verifying gofmt..."
hack/verify-gofmt.sh
failure $? "verify-gofmt.sh"
out=$(hack/verify-gofmt.sh 2>&1)
failure $? "verify-gofmt.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_GOLINT:-true}" == "true" ]]; then
echo "[*] Verifying golint..."
hack/verify-golint.sh
failure $? "verify-golint.sh"
out=$(hack/verify-golint.sh 2>&1)
failure $? "verify-golint.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_GOVET:-true}" == "true" ]]; then
echo "[*] Verifying govet..."
hack/verify-govet.sh
failure $? "verify-govet.sh"
out=$(hack/verify-govet.sh 2>&1)
failure $? "verify-govet.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_DEPS:-true}" == "true" ]]; then
echo "[*] Verifying deps..."
hack/verify-deps.sh
failure $? "verify-deps.sh"
out=$(hack/verify-deps.sh 2>&1)
failure $? "verify-deps.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_GOTEST:-true}" == "true" ]]; then
echo "[*] Verifying gotest..."
hack/verify-gotest.sh
failure $? "verify-gotest.sh"
out=$(hack/verify-gotest.sh 2>&1)
failure $? "verify-gotest.sh" "${out}"
cd "${REPO_PATH}"
fi

if [[ "${VERIFY_BUILD:-true}" == "true" ]]; then
echo "[*] Verifying build..."
hack/verify-build.sh
failure $? "verify-build.sh"
out=$(hack/verify-build.sh 2>&1)
failure $? "verify-build.sh" "${out}"
cd "${REPO_PATH}"
fi

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