Code review
【免费下载链接】claude-codeClaude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.项目地址: https://gitcode.com/GitHub_Trending/cl/claude-code
No issues found. Checked for bugs and CLAUDE.md compliance.
当发现问题时,评论按"## Code review"标题 + 编号列表组织,每条问题带描述与指向代码的链接,例如 README 中给出的形态: ```markdown ## Code review Found 3 issues: 1. Missing error handling for OAuth callback (CLAUDE.md says "Always handle OAuth errors") https://github.com/owner/repo/blob/abc123.../src/auth.ts#L67-L72 2. Memory leak: OAuth state not cleaned up (bug due to missing cleanup in finally block) https://github.com/owner/repo/blob/abc123.../src/auth.ts#L88-L95六、内联评论的代码链接规范
命令文件对评论中代码链接的格式做了硬性规定(否则 Markdown 预览无法正确渲染):
- 必须使用完整 git SHA(
git rev-parse HEAD之类的命令替换不会生效,因为评论会直接以 Markdown 渲染); - 仓库名必须与被审查的仓库一致;
- 文件名后使用
#号; - 行号区间格式为
L[start]-L[end]; - 评论目标行前后至少各包含 1 行上下文(例如评论 5-6 行时,链接到
L4-7)。
七、置信度评分体系
插件 README 为每条问题定义了 0-100 的置信度评分刻度(plugins/code-review/README.md):
| 分值 | 含义 |
|---|---|
| 0 | 不确信,误报 |
| 25 | 有点确信,可能是真的 |
| 50 | 中度确信,真实但次要 |
| 75 | 高度确信,真实且重要 |
| 100 | 绝对确定,必然为真 |
默认过滤阈值是 80,即只保留置信度 ≥ 80 的问题,低于阈值的一律不输出。过滤掉的典型误报类型(与命令文件第 4/5 步的误报清单一致)包括:存量问题、看似 Bug 实则正确、吹毛求疵、Linter 会抓的问题、通用质量问题(除非 CLAUDE.md 要求)、带 lint ignore 注释的问题。
八、使用方式与最佳实践
标准 PR 审查工作流
# 在 PR 分支上本地运行(输出到终端) /code-review # 审查反馈、修复问题后,作为 PR 评论发布 /code-review --comment # 确认无误后合并【免费下载链接】claude-codeClaude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.项目地址: https://gitcode.com/GitHub_Trending/cl/claude-code
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考