code-review-checklist

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Code Review Checklist Generator

代码审查清单生成器

Generate thorough, contextual code review checklists that help reviewers focus on what matters most for each specific PR.
生成全面且贴合上下文的代码审查清单,帮助审查人员专注于每个特定PR中最关键的内容。

When to Use

使用场景

  • Before starting a code review to know what to look for
  • When onboarding new team members to review standards
  • To ensure consistent review quality across the team
  • When reviewing unfamiliar parts of the codebase
  • 开始代码审查前,明确审查重点
  • 新团队成员入职时,熟悉审查标准
  • 确保团队内审查质量的一致性
  • 审查代码库中不熟悉的部分时

Approach

实现步骤

  1. Analyze the Diff: Understand what files changed and the nature of changes
  2. Identify Patterns: Detect the type of change (feature, bugfix, refactor, etc.)
  3. Language-Specific Checks: Apply relevant checks for the programming language
  4. Project Context: Consider existing patterns and conventions in the codebase
  5. Generate Checklist: Produce prioritized, actionable review items
  1. 分析差异:了解哪些文件发生了变更以及变更的性质
  2. 识别模式:判断变更类型(功能新增、Bug修复、代码重构等)
  3. 语言专属检查:应用对应编程语言的相关检查项
  4. 项目上下文考量:结合代码库中已有的模式和约定
  5. 生成清单:生成按优先级排序、可执行的审查项

Checklist Categories

清单分类

Security

安全

  • Input validation present
  • No hardcoded secrets or credentials
  • Proper authentication/authorization checks
  • SQL injection prevention
  • XSS prevention for web code
  • 存在输入验证
  • 无硬编码的密钥或凭证
  • 具备适当的身份验证/授权检查
  • 已采取SQL注入防护措施
  • Web代码已采取XSS防护措施

Performance

性能

  • No N+1 query patterns
  • Appropriate caching considered
  • No unnecessary loops or iterations
  • Efficient data structures used
  • 无N+1查询模式
  • 已考虑合适的缓存策略
  • 无不必要的循环或迭代
  • 使用了高效的数据结构

Maintainability

可维护性

  • Code is readable and self-documenting
  • Functions are appropriately sized
  • No code duplication
  • Consistent naming conventions
  • 代码可读性强,具备自描述性
  • 函数大小合适
  • 无代码重复
  • 命名约定保持一致

Testing

测试

  • Unit tests cover new functionality
  • Edge cases are tested
  • Tests are meaningful, not just for coverage
  • 单元测试覆盖了新增功能
  • 已测试边缘情况
  • 测试具备实际意义,而非仅为了覆盖率

Best Practices

最佳实践

  • Prioritize security issues first
  • Focus on logic errors over style nitpicks
  • Consider the reviewer's time - highlight critical items
  • Adapt checklist to project maturity level
  • 优先处理安全问题
  • 关注逻辑错误而非风格细节
  • 考虑审查人员的时间——突出关键项
  • 根据项目成熟度调整清单