From 77b1085ebac63e7231b5560dbb2ab0382d548ad4 Mon Sep 17 00:00:00 2001 From: andrew_li <6263928+xyz-li@users.noreply.github.com> Date: Wed, 20 Jul 2022 15:27:51 +0800 Subject: [PATCH] golint with new commit (#5074) --- hack/verify-golangci-lint.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hack/verify-golangci-lint.sh b/hack/verify-golangci-lint.sh index c4348590c..35b129e42 100755 --- a/hack/verify-golangci-lint.sh +++ b/hack/verify-golangci-lint.sh @@ -53,7 +53,14 @@ function error_exit { } trap "error_exit" EXIT -echo 'running golangci-lint ' +# Show only new issues created after git revision rev +rev="${REV:-origin/master}" +if [ -n "${PULL_BASE_REF}" ];then + echo "prow pull ref: ${PULL_BASE_REF}" + rev=origin/${PULL_BASE_REF} +fi + +echo "running golangci-lint: REV=${rev} " golangci-lint run \ --timeout 30m \ --disable-all \ @@ -65,4 +72,5 @@ golangci-lint run \ -E gosimple \ -E bodyclose \ --skip-dirs pkg/client \ + --new-from-rev="${rev}" \ pkg/... cmd/... tools/... test/... kube/...