Skip to content

ci(desktop): lint the desktop module with golangci-lint#4264

Merged
esengine merged 1 commit into
main-v2from
ci/desktop-golangci-lint
Jun 13, 2026
Merged

ci(desktop): lint the desktop module with golangci-lint#4264
esengine merged 1 commit into
main-v2from
ci/desktop-golangci-lint

Conversation

@esengine

Copy link
Copy Markdown
Owner

The desktop/ module is a separate Go module, and the root lint job (root go.mod) never covered it — so unused/errcheck/staticcheck findings accumulated unseen (the desktop job only ran gofmt/vet/build/test). Independent housekeeping, surfaced while reviewing #4250.

CI: add a golangci-lint step (v2.12.2, same root .golangci.yml) to the desktop job via working-directory: desktop.

Cleared the existing findings so the gate goes in green:

  • unused (12): dropped dead *ForTab "" delegators and orphaned helpers (notice, runEffortCommand, currentProviderEntry, setAutoApproveToolsForTab, workspacePath, active{Sink,Model,DisabledMCP,MCPOrder}, projectTitle, setTopicTitleSource, tabTelemetryPath). The *ForTab implementations they wrapped stay.
  • errcheck (9): made the best-effort json.Unmarshal / os.MkdirAll / os.WriteFile error-drops explicit (_ =); saveProjectsFile now returns the MkdirAll error since it already returns errors. The MigrateLegacyIfNeeded call from fix(migrate): import legacy default model and run migration before desktop config load #4224 was one of these.
  • staticcheck (2): tab.Scope if-chain → tagged switch (QF1003); deprecated strings.Titlecases.Title(language.Und) (SA1019; x/text is already a direct dep).

No behavior change. Verified locally: golangci-lint run clean on desktop, go build/vet clean, go mod tidy no-op. go test ./... passes except two failures that also fail on main-v2 (Windows TempDir flake + a test reading the dev box's real ~/.agents/skills) — neither present on Linux CI.

The desktop module is a separate Go module the root lint job never
covered, so unused funcs and unchecked errors accumulated unseen. Wire
golangci-lint (v2.12.2, root config) into the desktop CI job and clear
the existing findings: drop 12 unused funcs, make the best-effort
json.Unmarshal/MkdirAll/WriteFile error-ignores explicit, check MkdirAll
in saveProjectsFile, switch a tab.Scope if-chain to a tagged switch, and
replace the deprecated strings.Title with cases.Title.
@esengine esengine requested a review from SivanCola as a code owner June 13, 2026 06:43
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 13, 2026
@esengine esengine merged commit 4c4c235 into main-v2 Jun 13, 2026
14 checks passed
@esengine esengine deleted the ci/desktop-golangci-lint branch June 13, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant