chore(lint): pin golangci-lint to v1.64.8 in CI + make target#18
chore(lint): pin golangci-lint to v1.64.8 in CI + make target#18kevinelliott merged 1 commit intomainfrom
Conversation
Prevents the class of failure where CI pulls a newer golangci-lint that introduces rules the local `make lint` never sees. Both CI and Makefile now install the exact same version; bumping is a single-line change in two places (kept literal on both sides for discoverability). The Makefile target: - installs the pinned version into $(GOBIN) if missing or mismatched - normalizes the version string (with/without leading v) before compare - runs the installed binary by absolute path so mise/asdf shims don't win the PATH race While here, move the darwin-only uninstallCLI out of systray.go into a build-tagged file so //nolint:unused is no longer needed and `make lint` passes identically on darwin and linux. No behavior change — the function's only caller already has //go:build darwin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Pins golangci-lint to a specific version so local make lint results match CI, and narrows a systray uninstall helper to darwin-only builds.
Changes:
- Pin
golangci-linttov1.64.8in CI and in the Makefile’slinttarget. - Update
make lintto install/reinstall the pinned linter version into$(GOBIN)and run it via an absolute path. - Move
uninstallCLIout ofinternal/systray/systray.gointo a darwin build-tagged file.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/systray/systray.go |
Removes uninstallCLI from the shared systray implementation. |
internal/systray/cli_uninstall_darwin.go |
Adds darwin-only implementation of uninstallCLI. |
Makefile |
Pins golangci-lint version and ensures make lint installs/runs that exact version. |
.github/workflows/ci.yml |
Pins golangci-lint action to v1.64.8 to match local linting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| GOBIN ?= $(shell go env GOPATH)/bin | ||
|
|
||
| # Pinned tool versions (keep in sync with .github/workflows/ci.yml) | ||
| GOLANGCI_LINT_VERSION ?= v1.64.8 | ||
|
|
There was a problem hiding this comment.
GOBIN is derived from go env GOPATH, but GOPATH can be a list (colon-separated). With the updated lint target running $(GOBIN)/golangci-lint by absolute path, a multi-entry GOPATH would produce an invalid GOBIN like path1:path2/bin and break linting. Consider deriving GOBIN from go env GOBIN (and falling back to the first GOPATH entry when empty) so $(GOBIN) is always a single valid directory.
| func (a *App) uninstallCLI() bool { | ||
| targetPath := "/usr/local/bin/agentmgr" | ||
|
|
||
| switch a.platform.ID() { | ||
| case platform.Darwin, platform.Linux: | ||
| // Use osascript to run sudo with password prompt | ||
| script := fmt.Sprintf(` | ||
| do shell script "rm -f '%s'" with administrator privileges | ||
| `, targetPath) | ||
|
|
||
| cmd := exec.Command("osascript", "-e", script) | ||
| err := cmd.Run() | ||
| if err != nil { | ||
| return false | ||
| } | ||
|
|
||
| // Clear config path | ||
| a.config.Helper.CLIPath = "" | ||
| if a.configLoader != nil { | ||
| _ = a.configLoader.SetAndSave("helper.cli_path", "") | ||
| } | ||
| return true | ||
|
|
||
| case platform.Windows: | ||
| // Try to remove directly on Windows | ||
| targetPath = filepath.Join(os.Getenv("LOCALAPPDATA"), "agentmgr", "agentmgr.exe") | ||
| if err := os.Remove(targetPath); err != nil { |
There was a problem hiding this comment.
This file is //go:build darwin, so at runtime a.platform.ID() should always be platform.Darwin (it’s based on runtime.GOOS). The platform.Linux and platform.Windows branches are effectively dead code in this build, and they keep extra imports and platform-specific paths around unnecessarily. Consider simplifying the function to the darwin-only uninstall path (and removing the switch/unused branches) to avoid confusion and reduce maintenance surface.
Promote the Unreleased section to 1.1.0 and capture everything landed since v1.0.24: the parallel version-check perf work (#16), the google.golang.org/grpc CVE-2026-33186 security bump (#17), the golangci-lint pinning (#18), and the shared detect+version-check pipeline refactor (#19). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Prevents the class of failure we hit on PR #16, where CI used
golangci-lint@latestand picked up rules thatmake lintnever flagged locally. Both CI and Makefile now install the exact same version (v1.64.8); bumping is a single-line change in two places, kept literal on both sides for discoverability.Changes
CI (
.github/workflows/ci.yml): pinversion: v1.64.8with a comment pointing to the Makefile counterpart.Makefile (
linttarget):$(GOBIN)if missing or mismatchedvoptional) before comparing$(GOBIN)/golangci-lintsomise/asdfPATH shims don't winGOLANGCI_LINT_VERSIONvariable at the topSystray: moved darwin-only
uninstallCLIinto a build-tagged fileinternal/systray/cli_uninstall_darwin.go. Removes the stale//nolint:unused // Reserved for future usethat was only stale on darwin (the caller has//go:build darwin, so linux/windows saw the function as genuinely unused). No behavior change.Test plan
make linton darwin → passes (previously failed on stale nolint)make linton linux → passes (CI verifies)make lintwith no prior golangci-lint installed → installs v1.64.8 and runsmake lintwith a different version installed → reinstalls v1.64.8🤖 Generated with Claude Code