From 61335865d601860f134e4914437fceae356b7565 Mon Sep 17 00:00:00 2001 From: JonJagger Date: Tue, 28 Jul 2026 07:50:06 +0100 Subject: [PATCH 1/2] fix(lint): let make lint bootstrap golangci-lint on a fresh machine make lint could not run at all on a machine that had never installed golangci-lint: brew upgrade requires the formula to be present already, so the target died with "Error: golangci-lint not installed" before the linter ran. Checking for the formula and installing it when absent makes the target idempotent. The env var was also never reaching brew. Make expands $H (undefined) and leaves the literal OMEBREW_NO_AUTO_UPDATE, so every make lint triggered a full brew update, mutating the developer's brew installation as a side effect of linting. Dropping the $ passes the assignment to the shell. Presence-only, with no upgrade, also keeps local behaviour aligned with CI, which uses golangci-lint-action rather than brew. Closes #1038 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 808e95316..26cb675a2 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ fmt: ## Reformat package sources @go fmt ./... ensure_golangci-lint: - @$HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade golangci-lint + @HOMEBREW_NO_AUTO_UPDATE=1 brew list golangci-lint >/dev/null 2>&1 \ + || HOMEBREW_NO_AUTO_UPDATE=1 brew install golangci-lint lint: deps vet ensure_golangci-lint ## Run linting @golangci-lint run --timeout=5m --color always -v ./... From c2f232b398b12873bbbbd1ac1e551c33283da638 Mon Sep 17 00:00:00 2001 From: JonJagger Date: Tue, 28 Jul 2026 08:37:41 +0100 Subject: [PATCH 2/2] fix(lint): fix only the make expansion bug, keep brew upgrade The defect is the leading $: make reads $H (undefined) and leaves the literal OMEBREW_NO_AUTO_UPDATE, so brew never sees the env var and every make lint triggers a full brew update, mutating the developer's brew installation as a side effect of linting. Dropping the $ passes the assignment to the shell. Replacing upgrade with a presence-only install went beyond that defect and removed any way of keeping golangci-lint current, which is what review flagged. brew upgrade keeps the local linter moving with CI, which runs golangci-lint-action at version: latest. Bootstrapping on a machine that has never installed golangci-lint is a separate concern and stays out of scope here. --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 26cb675a2..bd5c99e1e 100644 --- a/Makefile +++ b/Makefile @@ -53,8 +53,7 @@ fmt: ## Reformat package sources @go fmt ./... ensure_golangci-lint: - @HOMEBREW_NO_AUTO_UPDATE=1 brew list golangci-lint >/dev/null 2>&1 \ - || HOMEBREW_NO_AUTO_UPDATE=1 brew install golangci-lint + @HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade golangci-lint lint: deps vet ensure_golangci-lint ## Run linting @golangci-lint run --timeout=5m --color always -v ./...