Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,7 +53,7 @@ fmt: ## Reformat package sources
@go fmt ./...

ensure_golangci-lint:
@$HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade golangci-lint
@HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade golangci-lint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $ expansion fix here is correct and worth keeping. In a Make recipe $H expands the (undefined) Make variable H to empty, leaving the literal OMEBREW_NO_AUTO_UPDATE=1 brew upgrade …. That stray token never sets the env var, so every make lint was actually triggering a full Homebrew auto-update. Dropping the $ passes the assignment through to the shell. Good catch. 👍

One caveat now that commit c2f232b3 reverted back to brew upgrade: on a machine that has never installed golangci-lint, brew upgrade golangci-lint still fails with Error: golangci-lint not installed — which is exactly the fresh-machine scenario in #1038. So with the current diff this target is not idempotent on a clean machine.

If keeping brew upgrade is the intended scope, consider making it self-bootstrapping without losing the upgrade behaviour:

Suggested change
@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 upgrade golangci-lint \
|| HOMEBREW_NO_AUTO_UPDATE=1 brew install golangci-lint

Re: @gsavage's questions — with brew upgrade kept, the linter does stay current (mechanism for keeping it up-to-date), and it's unpinned, which matches CI's golangci-lint-action at version: latest. Pinning to a specific version would be a deliberate separate change if you want local == a fixed CI version.


lint: deps vet ensure_golangci-lint ## Run linting
@golangci-lint run --timeout=5m --color always -v ./...
Expand Down
Loading