Skip to content

[lint-monster] targeted custom-lint fixes plus non-shared largefunc backlog (4 findings / 4 locations) #47900

Description

@github-actions

Summary

Current make golint-custom reports 4 targeted non-shared findings outside the shared pkg/workflow + pkg/cli function-length backlog. This slice covers two focused code-smell findings in pkg/cli plus one small long-function backlog in cmd/gh-aw and pkg/linters.

Findings in scope

  1. pkg/cli/mcp_inspect_inspector.go:65: defer inside a loop can delay cleanup until function return
  2. pkg/cli/docker_images.go:231: CheckAndPrepareDockerImages has 9 parameters (limit: 8); use an options struct or equivalent narrow API cleanup
  3. pkg/cli/grant.go:152: hard-coded file path /tmp/gh-aw-grant-policy.yaml; extract a named constant
  4. Long-function findings outside the shared backlog:
    • cmd/gh-aw/main.go:288: func literal is 129 lines
    • cmd/gh-aw/main.go:516: init is 447 lines
    • cmd/gh-aw/main.go:577: func literal is 72 lines
    • pkg/linters/stringbytesroundtrip/stringbytesroundtrip.go:52: analyzeRoundTrip is 73 lines

Expected outcome

Resolve the three targeted pkg/cli findings and reduce the remaining non-shared long-function backlog in cmd/gh-aw and pkg/linters with minimal, behavior-preserving edits.

Remediation checklist

  • Keep changes scoped to the findings above only
  • For the defer-in-loop warning, ensure per-iteration resources close in the same iteration
  • For the 9-parameter function, introduce a small options/config struct or equivalent targeted API cleanup
  • Replace the hard-coded temp-file path with a named constant
  • For the long functions, extract cohesive helpers instead of broad rewrites
  • Validate with make golint-custom

Fused skill guidance

  • Validate fixes by running make golint-custom
  • Keep remediation scoped to this lint group
  • Prefer minimal, targeted code edits

Generated by 🧌 LintMonster · gpt54 · 60.2 AIC · ⌖ 9.02 AIC · ⊞ 4.6K ·

  • expires on Jul 31, 2026, 7:43 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