Skip to content

[lint-monster] [LintMonster] parameter-count and small targeted CLI lint fixes (5 findings) #48510

Description

@github-actions

Summary

The latest make golint-custom scan found 5 targeted CLI lint findings that share a small-scope remediation pattern and are good candidates for one focused agent pass.

Findings in scope

  1. pkg/cli/mcp_inspect_inspector.go
    • defer inside a loop does not execute at the end of each iteration; it runs when the enclosing function returns, which can cause resource leaks
  2. pkg/cli/add_workflow_compilation.go
    • compileSafeOutputsWorkflowDependencies has 10 parameters (limit: 8); consider using an options struct
  3. pkg/cli/docker_images.go
    • CheckAndPrepareDockerImages has 9 parameters (limit: 8); consider using an options struct
  4. pkg/cli/run_interactive.go
    • RunWorkflowInteractively has 9 parameters (limit: 8); consider using an options struct
  5. pkg/cli/grant.go
    • hard-coded file path "/tmp/gh-aw-grant-policy.yaml": consider extracting as a named constant

Remediation checklist

  • Replace the defer-in-loop pattern with explicit close behavior scoped to each iteration.
  • Introduce minimal options/config structs for the three over-parameterized functions.
  • Extract the hard-coded temp path into a named constant near the call site.
  • Keep edits narrowly scoped to these five findings only.
  • Validate with make golint-custom.

Fused guidance

  • Prefer minimal, targeted code edits.
  • Do not expand scope beyond the listed findings.
  • Preserve behavior and existing tests.
  • Run make golint-custom to confirm these diagnostics are cleared.

Expected outcome

make golint-custom no longer reports these 5 findings, with no unrelated refactors mixed in.

Generated by 🧌 LintMonster · gpt54 · 20.5 AIC · ⌖ 4.97 AIC · ⊞ 4.7K ·

  • expires on Aug 3, 2026, 7:41 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