Skip to content

Commit 979f885

Browse files
authored
build: don't reinstall golangci-lint if already installed (#21662)
1 parent 88cfebe commit 979f885

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

scripts/build/linting.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
golangci_version=v1.60.1
2+
golangci_installed_version=$(shell golangci-lint version --format short 2>/dev/null)
23

34
#? setup-pre-commit: Set pre-commit git hook
45
setup-pre-commit:
@@ -9,8 +10,10 @@ setup-pre-commit:
910

1011
#? lint-install: Install golangci-lint
1112
lint-install:
13+
ifneq ($(golangci_installed_version),$(golangci_version))
1214
@echo "--> Installing golangci-lint $(golangci_version)"
1315
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
16+
endif
1417

1518
#? lint: Run golangci-lint
1619
lint:

0 commit comments

Comments
 (0)