| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
fix(cmdutil): SetFlagEnum returns error, no panic + spec rule (#415) #415: SetFlagEnum 在注解失败时 panic 让 CLI 崩溃,绕过 error 语义。spec 此前 无「禁止裸 panic」规则(issue 引用条文不存在),先补规则再修: - spec/foundations/coding-standards.md: 错误处理节加「禁止裸 panic」规则 (业务/运行期 error 返回;构造期非功能性元数据无法传播 error 时降级 stderr 告警+继续,不得崩溃;Must* 前缀显式 fail-fast;cobra 第三方不在范围) - pkg/cmdutil/flag_annotations.go: SetFlagEnum 改返 error(去 panic); 新增 SetFlagEnumOrWarn(构造期降级告警+继续,不崩溃) - pkg/cmdutil/format.go: AddFormatFlag/AddTimeFormatFlag 同包调用改 OrWarn - 18 处命令构造调用点 cmdutil.SetFlagEnum( → cmdutil.SetFlagEnumOrWarn( - pkg/cmdutil/flag_annotations_test.go: 新增 4 测试(注册 flag 注解成功; 未注册 flag 返 error 不 panic;OrWarn 不崩溃+stderr 告警;OrWarn 成功静默) 正确代码行为不变(注解照常设置);仅编程错误(注解未注册 flag)时从崩溃改为告警。 Closes #415 | 2 个月前 | |
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 个月前 | |
refactor(cmd): add BaseRepo auto-detection to 21 commands Closes #332 Each command's Options struct gains a BaseRepo func()(string,error) field, injected from f.BaseRepo, and run functions use cmdutil.ResolveRepo instead of direct ParseRepo, allowing repo auto-detection from cwd. Commands: commit comments (create/edit/list/list-by-sha/view), commit diff, commit patch, label create/delete, milestone create/delete, pr checkout/comments/create/merge/reply/test, release create/delete/upload, repo stats. | 3 个月前 | |
fix: downgrade browser open failure to warning in non-TTY environments When --web flag is used in CI/agent (non-TTY) environments, browser.Open() failure no longer causes non-zero exit. The resource is already successfully fetched and displayed; browser open is a convenience feature. - In TTY mode: browser.Open() errors are returned as before (users can react) - In non-TTY mode: browser.Open() errors print a warning to stderr but return nil (exit 0), preventing false failure signals for agents Affected commands: pr view, issue view, repo view, milestone view, commit view, release view, pr create Closes #341 Co-Authored-By: Claude <noreply@anthropic.com> | 4 个月前 | |
feat(help): add command search and discovery features Add custom help command with search and topic discovery features: - --search flag for keyword-based command search - --topics flag to list all available topic categories - --topic flag to filter commands by topic Add Topic annotations to 8 command categories: - auth, issues, pull-requests, releases, milestones, repo, commits, labels Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> | 6 个月前 |