ci(desktop): lint the desktop module with golangci-lint#4264
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
desktop/module is a separate Go module, and the rootlintjob (rootgo.mod) never covered it — sounused/errcheck/staticcheck findings accumulated unseen (the desktop job only ran gofmt/vet/build/test). Independent housekeeping, surfaced while reviewing #4250.CI: add a
golangci-lintstep (v2.12.2, same root.golangci.yml) to the desktop job viaworking-directory: desktop.Cleared the existing findings so the gate goes in green:
*ForTab"" delegators and orphaned helpers (notice,runEffortCommand,currentProviderEntry,setAutoApproveToolsForTab,workspacePath,active{Sink,Model,DisabledMCP,MCPOrder},projectTitle,setTopicTitleSource,tabTelemetryPath). The*ForTabimplementations they wrapped stay.json.Unmarshal/os.MkdirAll/os.WriteFileerror-drops explicit (_ =);saveProjectsFilenow returns theMkdirAllerror since it already returns errors. TheMigrateLegacyIfNeededcall from fix(migrate): import legacy default model and run migration before desktop config load #4224 was one of these.tab.Scopeif-chain → tagged switch (QF1003); deprecatedstrings.Title→cases.Title(language.Und)(SA1019;x/textis already a direct dep).No behavior change. Verified locally:
golangci-lint runclean on desktop,go build/vetclean,go mod tidyno-op.go test ./...passes except two failures that also fail onmain-v2(Windows TempDir flake + a test reading the dev box's real~/.agents/skills) — neither present on Linux CI.