-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[github] add copilot instructions #10626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📌 Code Review Assignment🏷️ Tag: workflowReviewers: @Rbb666 @kurisaW @supperthomas Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-08-21 10:56 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive instructions for GitHub Copilot to improve code review quality for the RT-Thread project. The instructions provide bilingual (English/Chinese) guidelines for reviewing real-time embedded system code with focus on RT-Thread-specific requirements.
- Establishes code review guidelines with emphasis on real-time performance, memory management, and RT-Thread coding standards
- Provides structured review comment format and severity levels for consistent feedback
- Documents RT-Thread-specific patterns including object-oriented design in C, naming conventions, and hardware constraints
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ### Review Focus Areas / 审查重点领域 | ||
|
|
||
| 1. **Real-Time Performance / 实时性能** | ||
| - Verify interrupt handling efficiency / 验证中断处理效率 |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interrupt handling efficiency guideline is too vague. Consider adding specific criteria such as 'Keep ISR execution time under X microseconds' or 'Avoid blocking operations in ISRs' to provide more actionable guidance.
| - Verify interrupt handling efficiency / 验证中断处理效率 | |
| - Verify interrupt handling efficiency: Keep ISR execution time under 10 microseconds; avoid blocking operations in ISRs / 验证中断处理效率:确保中断服务程序(ISR)执行时间不超过 10 微秒;避免在 ISR 中使用阻塞操作 |
| When reviewing kernel-related code: | ||
| 审查内核相关代码时: | ||
|
|
||
| - Verify rt_thread structure usage / 验证 rt_thread 结构使用 |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rt_thread structure usage guideline is incomplete. It should specify what aspects to verify, such as proper initialization, thread priority settings, or stack size validation.
| - Verify rt_thread structure usage / 验证 rt_thread 结构使用 | |
| - Verify rt_thread structure usage, including: | |
| - Proper initialization of the rt_thread structure / 正确初始化 rt_thread 结构体 | |
| - Correct thread priority settings / 正确设置线程优先级 | |
| - Appropriate stack size validation / 合理验证栈大小 |
| - **Public Functions / 公开函数**: `rt_[class]_[action]` | ||
| - **Static Functions / 静态函数**: `_[class]_[action]` | ||
| - **Hardware Functions / 硬件函数**: `rt_hw_` | ||
| - **Macros / 宏定义**: UPPERCASE (except for local function/variable macros) |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exception for 'local function/variable macros' is unclear. Consider providing examples or more specific criteria for when macros should not be UPPERCASE to avoid confusion.
| - **Macros / 宏定义**: UPPERCASE (except for local function/variable macros) | |
| - **Macros / 宏定义**: UPPERCASE for global macros. For macros that are local to a single function or file (such as small helpers or inline utilities), lowercase or mixed case may be used. | |
| - **Examples / 示例**: | |
| - Global macro: `#define RT_THREAD_PRIORITY_MAX 32` | |
| - Local macro (inside a function or file): `#define min(a, b) ((a) < (b) ? (a) : (b))` |
|
|
||
| - Use English for code comments / 所有代码注释使用英文 | ||
| - Markdown format for documentation / 文档使用Markdown格式 | ||
| - Prefer Mermaid for diagrams, or PlantUML (hide footbox in sequence diagrams) / 优先使用Mermaid绘图,或PlantUML(时序图隐藏footbox) |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The instruction to 'hide footbox in sequence diagrams' is a very specific PlantUML detail that seems out of place in general documentation guidelines. Consider moving this to a more detailed PlantUML style guide or removing it for brevity.
| - Prefer Mermaid for diagrams, or PlantUML (hide footbox in sequence diagrams) / 优先使用Mermaid绘图,或PlantUML(时序图隐藏footbox) | |
| - Prefer Mermaid for diagrams, or PlantUML / 优先使用Mermaid绘图,或PlantUML |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
让copilot更好的来review代码。
你的解决方案是什么 (what is your solution)
添加.github/copilot-instructions.md 文件
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up