P1: Fix 31 golangci-lint issues #1219

Closed
opened 2026-10-27 13:39:30 +00:00 by sam · 0 comments
Owner

31 golangci-lint issues clustered as high cyclomatic/cognitive complexity in:

  • internal/tools/builtin/find.go
  • internal/tools/builtin/grep.go
  • internal/tools/builtin/shell.go
  • internal/gateway/go:dispatchLocal

These are real refactor candidates, not noise.

Need to:

  • Review each issue to understand the complexity
  • Refactor functions to reduce cyclomatic complexity
  • Break down large functions into smaller, focused ones
  • Re-run golangci-lint to verify fixes

Blocked by: nothing

Notes

Fixed cyclop findings (applyEdits, grepFallback, grepDirFallback, serveReadContent, handleChatStream) and several gocognit/funlen findings (TDD, runFindGoFallback, makeGrepExecutor, makeShellExecutor). Remaining: richblocks.go markdownToBlocks/blocksToPlainText (gocognit), gateway.go dispatchLocal (gocyclo), agent.go Stage (gocognit 70), turn.go Run (gocognit 53), tomlwrite.go Apply (gocognit 82), cronstore store.go Update (gocognit) + nestif x2, toolset.go nestif. 22 of original 31 findings remain unaddressed -- keeping open.

Close reason

All 31 original findings (5 cyclop, 9 gocognit, 1 gocyclo, 2 nestif, plus incidental funlen) resolved via targeted extraction across tools/builtin, gateway, workflow, webui, telegram, cronstore, tomlwrite, agentexec. Remaining 6 lint findings (containedctx/errorlint/noctx/staticcheck) were never part of this bead's scope.


Imported from beads archie-core-agui · GitHub #658 · type task · priority P1 · created 2026-08-28 · closed 2026-08-31

31 golangci-lint issues clustered as high cyclomatic/cognitive complexity in: - internal/tools/builtin/find.go - internal/tools/builtin/grep.go - internal/tools/builtin/shell.go - internal/gateway/go:dispatchLocal These are real refactor candidates, not noise. Need to: - Review each issue to understand the complexity - Refactor functions to reduce cyclomatic complexity - Break down large functions into smaller, focused ones - Re-run golangci-lint to verify fixes Blocked by: nothing ### Notes Fixed cyclop findings (applyEdits, grepFallback, grepDirFallback, serveReadContent, handleChatStream) and several gocognit/funlen findings (TDD, runFindGoFallback, makeGrepExecutor, makeShellExecutor). Remaining: richblocks.go markdownToBlocks/blocksToPlainText (gocognit), gateway.go dispatchLocal (gocyclo), agent.go Stage (gocognit 70), turn.go Run (gocognit 53), tomlwrite.go Apply (gocognit 82), cronstore store.go Update (gocognit) + nestif x2, toolset.go nestif. 22 of original 31 findings remain unaddressed -- keeping open. ### Close reason All 31 original findings (5 cyclop, 9 gocognit, 1 gocyclo, 2 nestif, plus incidental funlen) resolved via targeted extraction across tools/builtin, gateway, workflow, webui, telegram, cronstore, tomlwrite, agentexec. Remaining 6 lint findings (containedctx/errorlint/noctx/staticcheck) were never part of this bead's scope. --- _Imported from beads `archie-core-agui` · GitHub #658 · type task · priority P1 · created 2026-08-28 · closed 2026-08-31_
sam added the hightask labels 2026-10-27 13:39:30 +00:00
sam self-assigned this 2026-10-27 13:39:30 +00:00
sam closed this issue 2026-10-27 13:39:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1219