Skip to content

[lint-monster] targeted custom-lint cleanup (2026-07-04) #43290

Description

@github-actions

Summary

Custom lint scan found 70 targeted findings outside the shared function-length refactoring backlog. These are low-risk, mechanical cleanups grouped by small correctness/style root causes.

Included root causes

  • defer inside loop causing delayed cleanup
  • excessive parameter count (options-struct candidate)
  • map[string]bool used as a set
  • redundant .Error() in formatting
  • discarded json.Unmarshal errors
  • len(s) > 0 instead of s != ""
  • len(strings.Split(...)) count anti-pattern
  • sort.Slice where slices.SortFunc is preferred
  • time.Sleep instead of select on ctx.Done()
  • non-shared largefunc findings under cmd/ and pkg/linters/

Representative diagnostics

  • pkg/cli/mcp_inspect_mcp_scripts_server.go:69: defer inside loop
  • pkg/cli/logs_orchestrator.go:151: buildContinuationIfNeeded has 11 parameters (limit: 8)
  • pkg/workflow/action_resolver.go: map[string]bool used as a set
  • pkg/workflow/frontmatter_error.go: redundant .Error() call
  • pkg/cli/logs_awinfo_backward_compat_test.go: discarded json.Unmarshal error
  • pkg/cli/mcp_inspect.go: use select with ctx.Done() instead of time.Sleep

Expected outcome

Resolve a coherent subset of these targeted findings with minimal edits and no behavioral regressions.

Remediation checklist

  • Keep remediation scoped to this lint group only.
  • Prefer minimal, targeted code edits.
  • Group work by one or two closely-related subcategories or files rather than trying to clear the whole bucket in one pass.
  • Preserve behavior and update tests only when required.
  • Validate fixes by running make golint-custom.

Suggested starting slice

Copilot execution notes

Use only the minimum relevant guidance: keep remediation tightly scoped to the assigned group, prefer direct local fixes over abstraction, and stop after make golint-custom confirms the touched diagnostics are addressed.

Generated by 🧌 LintMonster · 46.1 AIC · ⌖ 4.95 AIC · ⊞ 4.4K ·

  • expires on Jul 10, 2026, 7:49 PM UTC-08:00

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions