Skip to content

[lint-monster] Targeted custom-lint cleanup: resource lifecycle and API shape (2026-07-26) #48113

Description

@github-actions

Summary

Custom lint scan on 2026-07-26 found 3 targeted findings outside the shared function-length backlog that cluster around small, local API and resource-lifecycle fixes.

Findings

  • pkg/cli/mcp_inspect_inspector.go:65defer inside a loop delays cleanup until function return
  • pkg/cli/docker_images.go:245CheckAndPrepareDockerImages has 9 parameters (limit: 8); use an options struct or equivalent narrow API shaping
  • pkg/cli/grant.go:152 — hard-coded file path "/tmp/gh-aw-grant-policy.yaml"; extract to a named constant

Expected outcome

Apply minimal, targeted edits so these three diagnostics are removed without taking on unrelated cleanup.

Remediation checklist

  • Keep remediation scoped only to these three findings
  • Prefer the smallest safe code edits over broad redesign
  • Close loop-scoped resources at the end of each iteration instead of deferring to function return
  • Introduce a narrow options struct or equivalent local API cleanup only as needed for the excessive-parameter finding
  • Extract the hard-coded temp path to a named constant with unchanged behavior
  • Validate fixes by running make golint-custom

Fused guidance for the assignee

  • Keep remediation scoped to findings in this assigned lint group.
  • Prefer minimal, targeted code edits.
  • Validate with make golint-custom before handoff.

Generated by 🧌 LintMonster · gpt54 · 19.2 AIC · ⌖ 4.72 AIC · ⊞ 4.6K ·

  • expires on Aug 1, 2026, 7:47 PM UTC-08:00

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions