mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
Tweak test, update-fmt, add verify-fmt
Remove verifying gofmt from hack/test.sh. Make sure hack/update-fmt.sh ignores zz_generated files. Enable code simplification for gofmt. Add hack/verify-fmt.sh. Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
29
hack/test.sh
29
hack/test.sh
@@ -25,31 +25,4 @@ TARGETS=$(for d in "$@"; do echo ./$d/...; done)
|
||||
echo "Running tests:"
|
||||
go test -i -installsuffix "static" ${TARGETS}
|
||||
go test -installsuffix "static" -timeout 60s ${TARGETS}
|
||||
echo
|
||||
|
||||
echo -n "Checking gofmt: "
|
||||
ERRS=$(find "$@" -type f -name \*.go | xargs gofmt -l 2>&1 || true)
|
||||
if [ -n "${ERRS}" ]; then
|
||||
echo "FAIL - the following files need to be gofmt'ed:"
|
||||
for e in ${ERRS}; do
|
||||
echo " $e"
|
||||
done
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
echo "PASS"
|
||||
echo
|
||||
|
||||
# TODO(ncdc): there are govet failures in the generated clientset and the log error location hook
|
||||
# that prevent us from running vet at this time.
|
||||
#
|
||||
# echo -n "Checking go vet: "
|
||||
# ERRS=$(go vet ${TARGETS} 2>&1 || true)
|
||||
# if [ -n "${ERRS}" ]; then
|
||||
# echo "FAIL"
|
||||
# echo "${ERRS}"
|
||||
# echo
|
||||
# exit 1
|
||||
# fi
|
||||
# echo "PASS"
|
||||
# echo
|
||||
echo "Success!"
|
||||
|
||||
Reference in New Issue
Block a user