git-pr-reviewer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git PR Reviewer

Git PR Reviewer

Instructions

操作指南

When reviewing a pull request:
  1. Get the diff: Run
    git diff main...HEAD
    or
    git diff <base-branch>...HEAD
  2. Analyze changed files: Identify all modified, added, and deleted files
  3. Review each file for:
    • Logic errors and bugs
    • Security vulnerabilities (SQL injection, XSS, hardcoded secrets)
    • Performance issues (N+1 queries, unnecessary re-renders, memory leaks)
    • Code style and consistency
    • Missing error handling
    • Test coverage gaps
审核拉取请求时:
  1. 获取差异:运行
    git diff main...HEAD
    git diff <base-branch>...HEAD
  2. 分析变更文件:识别所有修改、新增和删除的文件
  3. 审核每个文件,检查:
    • 逻辑错误与bug
    • 安全漏洞(SQL injection、XSS、硬编码密钥)
    • 性能问题(N+1查询、不必要的重渲染、内存泄漏)
    • 代码风格与一致性
    • 缺失的错误处理
    • 测试覆盖缺口

Review Checklist

审核检查清单

Security

安全

  • No hardcoded credentials or API keys
  • Input validation on user data
  • Proper authentication/authorization checks
  • No SQL injection vulnerabilities
  • XSS prevention in place
  • 无硬编码凭证或API密钥
  • 对用户数据进行输入验证
  • 正确的身份验证/授权检查
  • 无SQL injection漏洞
  • 已采取XSS防护措施

Code Quality

代码质量

  • Functions are small and focused
  • No code duplication
  • Clear variable/function naming
  • Proper error handling
  • No unused imports or dead code
  • 函数小巧且职责单一
  • 无代码重复
  • 变量/函数命名清晰
  • 正确的错误处理
  • 无未使用的导入或死代码

Performance

性能

  • No unnecessary database queries
  • Efficient algorithms used
  • Proper caching where needed
  • No memory leaks
  • 无不必要的数据库查询
  • 使用高效算法
  • 在需要的地方正确缓存
  • 无内存泄漏

Testing

测试

  • New code has tests
  • Edge cases covered
  • Tests are meaningful, not just for coverage
  • 新代码配有测试
  • 覆盖边缘情况
  • 测试具有实际意义,而非仅为了覆盖率

Output Format

输出格式

markdown
undefined
markdown
undefined

PR Review Summary

PR Review Summary

Overview

Overview

[Brief summary of changes]
[Brief summary of changes]

Issues Found

Issues Found

Critical

Critical

  • [Issue description + file:line]
  • [Issue description + file:line]

Warnings

Warnings

  • [Issue description + file:line]
  • [Issue description + file:line]

Suggestions

Suggestions

  • [Improvement ideas]
  • [Improvement ideas]

Approval Status

Approval Status

[APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]
undefined
[APPROVE / REQUEST CHANGES / NEEDS DISCUSSION]
undefined

Example

示例

bash
undefined
bash
undefined

Review current branch against main

Review current branch against main

git diff main...HEAD --stat git diff main...HEAD
undefined
git diff main...HEAD --stat git diff main...HEAD
undefined