From 979f8858856bd9374894b7b843e59e8cf11bd3c5 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 12 Sep 2024 14:47:07 +0800 Subject: [PATCH] build: don't reinstall golangci-lint if already installed (#21662) --- scripts/build/linting.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build/linting.mk b/scripts/build/linting.mk index 58d481a235fb..6e723c5f84f7 100644 --- a/scripts/build/linting.mk +++ b/scripts/build/linting.mk @@ -1,4 +1,5 @@ golangci_version=v1.60.1 +golangci_installed_version=$(shell golangci-lint version --format short 2>/dev/null) #? setup-pre-commit: Set pre-commit git hook setup-pre-commit: @@ -9,8 +10,10 @@ setup-pre-commit: #? lint-install: Install golangci-lint lint-install: +ifneq ($(golangci_installed_version),$(golangci_version)) @echo "--> Installing golangci-lint $(golangci_version)" @go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version) +endif #? lint: Run golangci-lint lint: