Skip to content

[function-namer] Go function rename plan: pkg/linters/seenmapbool #77426

Done

Description

@github-actions

🏷️ Go Function Rename Plan

Package Analyzed: pkg/linters/seenmapbool
Analysis Date: 2026-11-13
Round-Robin Position: package 89 of 154 real packages (testdata fixtures excluded)
Functions Analyzed: 8 functions across 1 file

Why This Matters

AI coding agents find functions by name. inspectBody says nothing about what the function does. It actually reports seen-map candidates, so an agent looking for that logic is unlikely to land on it. A name that states the job makes the function easier to find.

Rename Suggestions

pkg/linters/seenmapbool/seenmapbool.go

Current Name Suggested Name Reason
inspectBody() reportSeenMapBoolCandidates() inspect is a generic verb. The function collects local map[string]bool candidates in a function body, drops those assigned a non-true value, and reports the rest. The new name states that and uses the analyzer vocabulary.

All functions in this file (for reference):

  • init(): ✅ Clear, no change needed (registers the hot-threshold flag)
  • run(): ✅ Keep. It is the standard analysis pass name used by all 91 linter files in pkg/linters
  • inspectBody(): ⚠️ Rename suggested (see table above)
  • collectSeenMapCandidates(): ✅ Clear
  • findNonSetMaps(): ✅ Clear
  • markIfNonSetLiteral(): ✅ Descriptive, though long
  • isMapStringBool(): ✅ Clear
  • isBoolTrue(): ✅ Clear

Call-site check: Serena find_referencing_symbols and grep both show one caller, run in the same file. The package testdata does not reference it. Separate unexported inspectBody functions exist in pkg/linters/wgdonenotdeferred and pkg/linters/internal/resourcetracker. They are out of scope for this plan.

🤖 Agentic Implementation Plan

Agentic Implementation Plan

This is one rename in one file. Implement it as a single focused pull request.

Prerequisites

  • Read inspectBody in pkg/linters/seenmapbool/seenmapbool.go and confirm it reports candidates
  • Confirm reportSeenMapBoolCandidates is not already declared in pkg/

Implementation Steps

1. Rename the function in pkg/linters/seenmapbool/seenmapbool.go

// Old
func inspectBody(pass *analysis.Pass, body *ast.BlockStmt, noLintIndex nolint.DirectiveIndex) {

// New
func reportSeenMapBoolCandidates(pass *analysis.Pass, body *ast.BlockStmt, noLintIndex nolint.DirectiveIndex) {

Also update the doc comment that starts with // inspectBody walks and the single call in run.

2. Confirm no references remain

grep -rn "inspectBody" pkg/linters/seenmapbool/

This should return nothing after the edit. Do not rename the inspectBody functions in wgdonenotdeferred or resourcetracker. They are separate functions.

3. Format, build, and test

make fmt
make build
make test-unit
make lint

Commit Convention

refactor: rename inspectBody to reportSeenMapBoolCandidates for clarity

Validation Checklist

  • inspectBody renamed in the definition, the doc comment, and the run call
  • No remaining inspectBody references in pkg/linters/seenmapbool/
  • make fmt, make build, make test-unit, and make lint pass
  • PR description explains the agent-discoverability rationale

Notes for the Agent

  • This is a pure rename. Behavior must not change.
  • If the new name conflicts with an existing identifier, skip the rename and explain why in the PR.
  • The testdata fixture under pkg/linters/seenmapbool/testdata/src/seenmapbool does not reference the function and needs no change.

References: §43418930854

Generated by 🔧 Daily Go Function Namer · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 8.3K · ◷

  • expires on Nov 20, 2026, 3:49 AM UTC-08:00

Activity

  1. github-actions commented on Nov 13, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster selected this for Copilot

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, Copilot will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    🍪 Om nom nom by Issue Monster · pi · gpt50 · ~1 AIC · ⌖ ~1 AIC · ⊞ 11K · ◷

  2. linked a pull request that will close this issueClarify seen-map candidate reporter name #77575on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions