Skip to content

[lint-monster] lint-monster: targeted custom-lint cleanup #42882

Description

@github-actions

Summary

Custom lint scan found 77 targeted findings outside the shared function-length backlog. These combine a small number of non-shared long functions with several narrow lint categories that are suitable for one focused cleanup pass.

Included root causes

  • defer inside loop causing delayed cleanup
  • discarded json.Unmarshal errors
  • map[string]bool used as a set
  • redundant .Error() in formatting
  • 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 long functions in cmd/gh-aw and pkg/linters

Representative diagnostics

  • pkg/cli/mcp_inspect_mcp_scripts_server.go:69: defer inside loop
  • pkg/cli/logs_awinfo_backward_compat_test.go:173: discarded json.Unmarshal error
  • pkg/workflow/action_resolver.go:38: map[string]bool used as a set
  • pkg/workflow/frontmatter_error.go:136: redundant .Error() call
  • pkg/workflow/codex_logs.go:17: use strings.Count(...)+1
  • pkg/cli/mcp_inspect.go:138: 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

  • Pick one or two related subcategories or files rather than the entire bucket.
  • Keep changes minimal and localized.
  • Preserve behavior and update tests only when required.
  • Validate with make golint-custom.

Suggested starting slice

  • fix the defer-in-loop and discarded-unmarshal findings first
  • optionally include nearby low-risk style fixes in the same touched files
  • leave unrelated long-function refactors for their dedicated tracking issue

Notes for the agent

This issue intentionally excludes the shared function-length refactoring backlog in pkg/workflow and pkg/cli.

Generated by 🧌 LintMonster · 31.5 AIC · ⌖ 22.3 AIC · ⊞ 4.4K ·

  • expires on Jul 8, 2026, 7:50 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions