You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**When reviewing Pull Requests (PRs), you MUST check all items in the PR Review Checklist section and provide feedback according to the PR Review Instructions. / 在审查 Pull Request (PR) 时,必须检查 PR 审查清单部分中的所有项目,并根据 PR 审查指令提供反馈。**
10
+
9
11
## Code Review Guidelines / 代码审查指南
10
12
11
13
### Language Requirements / 语言要求
@@ -26,21 +28,162 @@ When reviewing code, provide feedback in **both English and Chinese** to ensure
- 示例:[NXP][UART] Add timeout handling for UART receive。
40
-
-**Issues to Avoid / 避免的问题**:
41
-
- 不要使用模糊的术语,如“修复问题”或“代码优化”,需具体说明问题或优化的内容。
42
-
- 避免使用不规范的符号(如 ——),建议使用标准英文字符(如 - 或 :)。
43
-
- 不要省略关键上下文信息,如 BSP 或芯片厂商。
31
+
4.**PR Review Checklist / PR 审查清单**
32
+
-**PR Title Review / PR 标题审查**:
33
+
- Check if PR title has proper prefix format / 检查 PR 标题是否有正确的前缀格式
34
+
- Verify prefix follows pattern: `[module/vendor][subsystem]` or `[module/vendor]` in lowercase / 验证前缀遵循格式:小写的 `[模块/厂商][子系统]` 或 `[模块/厂商]`
35
+
- Verify title describes changes based on modified files / 验证标题基于修改的文件描述变更
36
+
- Check if title is specific enough (avoid vague terms like "fix bug", "optimize code") / 检查标题是否足够具体(避免模糊术语如"修复问题"、"代码优化")
37
+
- If title lacks prefix or uses incorrect format, suggest: "PR title should follow format: `[module][subsystem] Description`. Example: `[stm32][drivers] Fix UART interrupt handling issue`" / 如果标题缺少前缀或格式错误,建议:"PR 标题应遵循格式:`[模块][子系统] 描述`。示例:`[stm32][drivers] Fix UART interrupt handling issue`"
38
+
-**PR Description Review / PR 内容审查**:
39
+
- Check if PR description provides overview of modified files / 检查 PR 描述是否提供了修改文件的总概
40
+
- Verify description explains: What (what changes), Why (why needed), How (which files modified) / 验证描述是否说明:What(做了什么修改)、Why(为什么需要)、How(修改了哪些文件)
41
+
- If description is missing or insufficient, suggest adding description with modified files list / 如果描述缺失或不充分,建议添加包含修改文件列表的描述
42
+
-**PR File Modification Review / PR 修改文件审查**:
43
+
- Check if PR contains multiple unrelated features / 检查 PR 是否包含多个不相关的特性
44
+
- If PR mixes multiple features, suggest splitting into separate PRs / 如果 PR 混杂多个特性,建议拆分为多个 PR
45
+
- Verify all file changes are related to the same feature/bug fix / 验证所有文件修改是否与同一功能/错误修复相关
46
+
-**PR Commit Review / PR Commit 审查**:
47
+
- Check commit message format (should follow PR title format) / 检查 commit 消息格式(应遵循 PR 标题格式)
48
+
- Verify if commits are properly organized / 验证 commit 是否组织得当
49
+
- If routine changes (style fixes, minor bugs, docs, typos) are split into multiple commits, suggest squashing them / 如果常规修改(风格修复、小错误、文档、拼写)被拆分为多个 commit,建议压缩它们
50
+
- Important commits (major features, refactoring, critical bugs) can remain separate / 重要提交(主要功能、重构、关键错误)可以保持独立
51
+
- If commit messages don't follow format, suggest: "Commit message should follow format: `[module][subsystem] Description`. Consider squashing routine changes into one commit." / 如果 commit 消息不符合格式,建议:"Commit 消息应遵循格式:`[模块][子系统] 描述`。考虑将常规修改压缩为一个 commit。"
52
+
53
+
### PR Review Instructions / PR 审查指令
54
+
55
+
**When reviewing a PR, you MUST systematically check the following items and provide feedback for any violations / 审查 PR 时,必须系统性地检查以下项目,并对任何违规行为提供反馈:**
56
+
57
+
#### Step 1: PR Title Check / 步骤 1:PR 标题检查
58
+
59
+
1.**Check prefix format / 检查前缀格式**:
60
+
- Extract the PR title from the PR / 从 PR 中提取 PR 标题
61
+
- Verify if it starts with `[module][subsystem]` or `[module]` pattern in lowercase / 验证是否以小写的 `[模块][子系统]` 或 `[模块]` 格式开头
62
+
- Check if prefix matches the modified files (e.g., if files are in `bsp/stm32/drivers/`, prefix should be `[stm32][drivers]` or similar) / 检查前缀是否与修改的文件匹配(例如,如果文件在 `bsp/stm32/drivers/`,前缀应为 `[stm32][drivers]` 或类似)
63
+
- If prefix is missing, incorrect case (e.g., `[STM32]`), or doesn't match files, provide feedback / 如果前缀缺失、大小写错误(如 `[STM32]`)或不匹配文件,提供反馈
64
+
-**Feedback template / 反馈模板**:
65
+
```
66
+
🟡 [PR Title/PR 标题]: Missing or incorrect prefix format / 缺少或错误的前缀格式
67
+
68
+
English: PR title should follow format: `[module][subsystem] Description` in lowercase.
69
+
Current title: `{current_title}`.
70
+
Based on modified files, suggested title: `{suggested_title}`.
71
+
72
+
中文:PR 标题应遵循格式:小写的 `[模块][子系统] 描述`。
73
+
当前标题:`{current_title}`。
74
+
基于修改的文件,建议标题:`{suggested_title}`。
75
+
```
76
+
77
+
2. **Check title specificity / 检查标题具体性**:
78
+
- Analyze modified files to understand what changes were made / 分析修改的文件以了解所做的更改
79
+
- Verify if title accurately describes changes based on modified files / 验证标题是否基于修改的文件准确描述更改
80
+
- Check for vague terms: "fix bug", "optimize code", "update", "modify", etc. / 检查模糊术语:"修复问题"、"代码优化"、"更新"、"修改"等
81
+
- If title is vague or doesn't match modified files, suggest a more specific title / 如果标题模糊或不匹配修改的文件,建议更具体的标题
82
+
- **Feedback template / 反馈模板**:
83
+
```
84
+
🟡 [PR Title/PR 标题]: Title is too vague or doesn't match modified files / 标题过于模糊或不匹配修改的文件
85
+
86
+
English: PR title should specifically describe changes based on modified files.
87
+
Current title: `{current_title}`.
88
+
Suggested: `{suggested_title}` based on files: {list_modified_files}.
- List of modified files (optional but recommended) / 修改文件列表(可选但推荐)
104
+
- If description is missing, empty, or insufficient, provide feedback / 如果描述缺失、为空或不充分,提供反馈
105
+
- **Feedback template / 反馈模板**:
106
+
```
107
+
🟢 [PR Description/PR 描述]: Missing or insufficient description / 缺少或不充分的描述
108
+
109
+
English: PR description should include: (1) Overview of modified files, (2) What changes were made, (3) Why changes are needed, (4) List of modified files (optional).
0 commit comments