Draft
fix: resolve three targeted lint-monster diagnostics (defer-in-loop, excess params, hardcoded path)#48520
Conversation
Open
7 tasks
…rdcoded path - mcp_inspect_inspector.go: move timer.Stop() out of defer/loop to close per iteration instead of deferring to function return - docker_images.go: introduce DockerImagesOptions struct to reduce CheckAndPrepareDockerImages from 9 to 2 parameters; update all callers and tests - grant.go: extract hard-coded '/tmp/gh-aw-grant-policy.yaml' to named constant grantContainerPolicyPath Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix custom lint issues in API and resource lifecycle
fix: resolve three targeted lint-monster diagnostics (defer-in-loop, excess params, hardcoded path)
Jul 28, 2026
Contributor
Great work on the targeted cleanup! 🚀This PR looks excellent — it systematically addresses three specific lint-monster diagnostics while maintaining focus and including proper test updates:
The diff is focused, tests are updated, and the description is clear. This is ready for review!
|
Contributor
PR Triage
Targeted lint-monster diagnostic fixes (defer-in-loop, param count, hardcoded path). Draft status, no CI yet. Low urgency, batchable with other lint-monster PRs.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three custom-lint findings from the 2026-07-26 scan:
deferinside a loop, a 9-parameter function exceeding the 8-param limit, and a hardcoded/tmppath.Changes
mcp_inspect_inspector.go— Movetimer.Stop()out ofdeferinto direct call after eachselect, so timers are released per iteration rather than piling up until function return.docker_images.go— Replace the 8boolparameters onCheckAndPrepareDockerImageswith aDockerImagesOptionsstruct:Caller in
mcp_tools_readonly.goand all tests updated accordingly.grant.go— Extract the literal"/tmp/gh-aw-grant-policy.yaml"to a named constantgrantContainerPolicyPath; no behavior change.