[function-namer] Go function rename plan: pkg/linters/sprintfbool
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
工作位于 pkg/linters/sprintfbool/sprintfbool.go。先阅读 replacementForCall(它由 analyzeSprintfBool 调用)和 buildStrconvFmtImportEdits(它由 buildFormatBoolFix 调用),然后 grep 提议的新名称以确认它们未被占用。完成意味着两个函数都已重命名并更新了各自的文档注释,不再有对旧名称的引用,并且 make test-unit 通过。
由索引模型根据 Issue 内容生成。
描述
🏷️ Go Function Rename Plan
Package Analyzed: pkg/linters/sprintfbool
Analysis Date: 2026-11-21
Round-Robin Position: package 191 of 281 total packages
Functions Analyzed: 7 functions across 1 file
The round-robin pick at index 190 was a testdata fixture directory, so it was skipped and the next real package was analyzed.
Why This Matters
When AI coding agents search for functions to complete a task, they rely on function names to understand what code does. Clear, descriptive names increase the likelihood that an agent will find the right function instead of reimplementing existing logic.
Rename Suggestions
pkg/linters/sprintfbool/sprintfbool.go
| Current Name | Suggested Name | Reason |
|---|---|---|
replacementForCall() |
resolveFormatBoolReplacement() |
The name does not say what replacement is produced (strconv.FormatBool) or that it also decides whether the auto-fix is allowed (canFix). The sibling buildFormatBoolFix() already uses the FormatBool vocabulary, so this function is the outlier. |
buildStrconvFmtImportEdits() |
buildFmtToStrconvImportEdits() |
The name does not show direction. The function adds the strconv import and removes fmt when it becomes orphaned, so the name should show the fmt to strconv swap. |
All functions in this file (for reference)
analyzeSprintfBool()— ✅ Clear, no change neededcollectSprintfBoolCandidates()— ✅ Clear, no change neededcomputeOrphanedFmtImportStatus()— ✅ Clear, no change neededreportSprintfBoolDiagnostics()— ✅ Clear, no change neededbuildFormatBoolFix()— ✅ Clear, no change neededbuildStrconvFmtImportEdits()— ⚠️ Rename suggested (see table above)replacementForCall()— ⚠️ Rename suggested (see table above)
Call sites (checked with Serena find_referencing_symbols and grep across pkg/ and cmd/, test files included):
replacementForCall: 1 caller,analyzeSprintfBool(sprintfbool.go:57)buildStrconvFmtImportEdits: 1 caller,buildFormatBoolFix(sprintfbool.go:185)- No references in
_test.gofiles, so no test updates are needed.
🤖 Agentic Implementation Plan
Agentic Implementation Plan
This issue is designed to be assigned to a coding agent. Implement both renames in a single pull request.
Prerequisites
- Read
replacementForCallandbuildStrconvFmtImportEditsinpkg/linters/sprintfbool/sprintfbool.goand confirm each suggestion matches the function body - Confirm the new names are not already in use:
grep -rn "resolveFormatBoolReplacement\|buildFmtToStrconvImportEdits" --include="*.go" pkg/ cmd/
Implementation Steps
1. Rename replacementForCall to resolveFormatBoolReplacement
In pkg/linters/sprintfbool/sprintfbool.go:
- Update the declaration (line 219)
- Update the single call site in
analyzeSprintfBool(line 57)
// Old
func replacementForCall(pass *analysis.Pass, call *ast.CallExpr, arg ast.Expr, file *ast.File) replacement {
// New
func resolveFormatBoolReplacement(pass *analysis.Pass, call *ast.CallExpr, arg ast.Expr, file *ast.File) replacement {
2. Rename buildStrconvFmtImportEdits to buildFmtToStrconvImportEdits
- Update the declaration (line 198) and its doc comment (lines 194-197) so the comment starts with the new name
- Update the single call site in
buildFormatBoolFix(line 185)
3. Verify no old references remain
grep -rn "replacementForCall\|buildStrconvFmtImportEdits" --include="*.go" pkg/ cmd/
Expected: no matches after the rename.
4. Format, build, and test
make fmt
make build
make test-unit
make lint
Commit Convention
refactor: rename replacementForCall and buildStrconvFmtImportEdits for clarity
Validation Checklist
- Both renames implemented in
sprintfbool.goonly - Doc comments updated to match the new names
- No remaining references to the old names
-
make fmtproduces no diff -
make buildpasses -
make test-unitpasses (analysistestfixtures undertestdata/are unaffected) -
make lintpasses - PR description explains the agent-discoverability rationale
Notes for the Agent
- This is a pure rename refactor. Behavior must not change.
- Both functions are unexported, so no interface constraints apply.
- If a rename conflicts with an existing identifier, skip it and explain why in the PR.
References: §44900201111
Generated by 🔧 Daily Go Function Namer · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 8.3K · ◷
- expires on Nov 28, 2026, 3:48 AM UTC-08:00
- 主要语言
- Go
- 星标
- 5.7k
- 派生
- 635
- 平均合并
- 3 小时 43 分钟
- 30 天内合并 PR
- 838
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-aw 的其他 Issue
-
automation backlog:reports documentation
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
ai-inspected
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
ai-inspected
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
ai-inspected backlog:security
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Bug: arc-dind generated Copilot CLI staging step fails when source and destination are the same file未关闭ai-inspected arc awf backlog:runners-tools community
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
unbound-force/replicator#193 ·
维护者通常 2 天内回复
-
A Gemini stream that fails partway completes the call with the partial text可能已有人在做 @bnaylor 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
go-steer/core-agent#1600 ·
维护者通常 1 天内回复
-
bug raised-by:reviewer
难度 2/5 1-3 小时 新手友好度 66/100
medici-finance/assay#7655 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
Edwin-metcalf/MetCode#67 ·
维护者通常 1 天内回复
-
bug good first issue
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复