Skip to content

Conversation

@BernardXiong
Copy link
Member

拉取/合并请求描述:(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)

  • BSP:
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions github-actions bot added the action github action yml imporve label Aug 21, 2025
@github-actions
Copy link

📌 Code Review Assignment

🏷️ Tag: workflow

Reviewers: @Rbb666 @kurisaW @supperthomas

Changed Files (Click to expand)
  • .github/copilot-instructions.md

📊 Current Review Status (Last Updated: 2025-08-21 10:56 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@supperthomas supperthomas requested a review from Copilot August 21, 2025 03:49
Copy link
Contributor

Copilot AI left a 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 / 验证中断处理效率
Copy link

Copilot AI Aug 21, 2025

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.

Suggested change
- Verify interrupt handling efficiency / 验证中断处理效率
- Verify interrupt handling efficiency: Keep ISR execution time under 10 microseconds; avoid blocking operations in ISRs / 验证中断处理效率:确保中断服务程序(ISR)执行时间不超过 10 微秒;避免在 ISR 中使用阻塞操作

Copilot uses AI. Check for mistakes.
When reviewing kernel-related code:
审查内核相关代码时:

- Verify rt_thread structure usage / 验证 rt_thread 结构使用
Copy link

Copilot AI Aug 21, 2025

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.

Suggested change
- 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 / 合理验证栈大小

Copilot uses AI. Check for mistakes.
- **Public Functions / 公开函数**: `rt_[class]_[action]`
- **Static Functions / 静态函数**: `_[class]_[action]`
- **Hardware Functions / 硬件函数**: `rt_hw_`
- **Macros / 宏定义**: UPPERCASE (except for local function/variable macros)
Copy link

Copilot AI Aug 21, 2025

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.

Suggested change
- **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))`

Copilot uses AI. Check for mistakes.

- Use English for code comments / 所有代码注释使用英文
- Markdown format for documentation / 文档使用Markdown格式
- Prefer Mermaid for diagrams, or PlantUML (hide footbox in sequence diagrams) / 优先使用Mermaid绘图,或PlantUML(时序图隐藏footbox)
Copy link

Copilot AI Aug 21, 2025

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.

Suggested change
- Prefer Mermaid for diagrams, or PlantUML (hide footbox in sequence diagrams) / 优先使用Mermaid绘图,或PlantUML(时序图隐藏footbox)
- Prefer Mermaid for diagrams, or PlantUML / 优先使用Mermaid绘图,或PlantUML

Copilot uses AI. Check for mistakes.
@Rbb666 Rbb666 merged commit 3b93a78 into RT-Thread:master Aug 21, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action github action yml imporve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants