Skip to content

Commit

Permalink
chores: don't reinstall golangci-lint if already installed
Browse files Browse the repository at this point in the history
lint-install should be no-op if the same version is already
installed in order to preserve user's environment and not
overwrite user's tools and config.
  • Loading branch information
alessio committed Sep 11, 2024
1 parent 4fe934e commit 991abcb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/build/linting.mk
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 991abcb

Please sign in to comment.