Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Creates .github/copilot-instructions.md to provide organization-wide Copilot guidance for all linuxdeepin repositories.

Requirements Implemented

  • Bilingual code review comments: Enforces English + Chinese format for all review feedback
  • SPDX copyright header validation: Auto-checks date format in file headers
    • New files: must include current year
    • Modified files: year range when created in earlier year (e.g., 2023-current year)
  • Bilingual commit messages: Structured format with type, description, and impact analysis in both languages

File Structure

## 1. 双语代码审查评论
- 格式模板和示例

## 2. SPDX 版权头验证
- 不同文件类型的所需格式
- 新文件与修改文件的验证规则
- 审查评论示例

## 3. 双语提交消息格式
- 提交类型模板 (feat/fix/docs/等)
- 来自 linuxdeepin/treeland 的完整示例

Implementation Details

  • Chinese-only documentation: The instruction file itself is written in Chinese for human readability, reducing token usage while maintaining clarity
  • Generic year references: Uses "current year" concept instead of hardcoded years, ensuring the document remains valid without annual updates
  • Future-proof design: Instructions will work correctly regardless of the current year

References the existing treeland repository implementation, adapted for organization-wide use. The .github repository automatically provides these defaults to all org repositories.

Original prompt

Add Organization-wide GitHub Copilot Instructions

Objective / 目标

Create a .github/copilot-instructions.md file in the linuxdeepin/.github repository to provide organization-wide instructions for GitHub Copilot across all repositories in the linuxdeepin organization.

为 linuxdeepin/.github 仓库创建 .github/copilot-instructions.md 文件,为 linuxdeepin 组织中的所有仓库提供组织级的 GitHub Copilot 指导。

Requirements / 需求

1. Bilingual Code Review Comments / 双语代码审查评论

Copilot must provide all code review comments in both English and Chinese. Never use English only.

Copilot 必须提供所有代码审查评论的中英文双语版本。绝不能只使用英文。

Format example / 格式示例:

[English comment]

[Chinese comment - 中文评论]

2. SPDX Copyright Header Validation / SPDX 版权头验证

When reviewing code changes, Copilot must automatically check SPDX copyright headers for proper date formatting.

在审查代码更改时,Copilot 必须自动检查 SPDX 版权头的日期格式是否正确。

Required Format / 所需格式:

// SPDX-FileCopyrightText: YYYY[-YYYY] UnionTech Software Technology Co., Ltd.

Validation Rules / 验证规则:

For new files / 对于新文件:

  • Must include SPDX header with current year (2026)
  • 必须包含带有当前年份 (2026) 的 SPDX 头
  • Example: // SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.

For modified files / 对于修改的文件:

  • If file was created in the same year as modification: single year format

  • 如果文件在与修改相同的年份创建:单年份格式

    • Example: // SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
  • If file was created in an earlier year: year range format (YYYY-YYYY)

  • 如果文件在更早的年份创建:年份范围格式 (YYYY-YYYY)

    • First YYYY = file creation year / 第一个 YYYY = 文件创建年份
    • Second YYYY = last modification year / 第二个 YYYY = 最后修改年份
    • Example: // SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd.

Important: Only use range format (YYYY-YYYY) when the years differ. If they are the same, use single year format.

重要: 只有当年份不同时才使用范围格式 (YYYY-YYYY)。如果年份相同,使用单年份格式。

Copilot must remind developers if:

  • New files are missing SPDX headers
  • New files have incorrect year
  • Modified files have not updated the year to current year (2026)

Copilot 必须提醒开发者如果:

  • 新文件缺少 SPDX 头
  • 新文件的年份不正确
  • 修改的文件未将年份更新为当前年份 (2026)

3. Bilingual Commit Message Format / 双语提交消息格式

All commit messages generated by Copilot must follow this bilingual format:

所有由 Copilot 生成的提交消息都必须遵循这个双语格式:

<type>: <English summary>

<English detailed description>
- Key change 1
- Key change 2

Influence:
1. <Impact point 1>
2. <Impact point 2>
3. <Testing recommendation>

<type>: <中文摘要>

<中文详细描述>
- 关键变更 1
- 关键变更 2

Influence:
1. <影响点 1>
2. <影响点 2>
3. <测试建议>

Commit Types / 提交类型:

  • feat: New feature (新功能)
  • fix: Bug fix (问题修复)
  • docs: Documentation changes (文档更改)
  • style: Code style/formatting (代码风格/格式化)
  • refactor: Code refactoring (代码重构)
  • perf: Performance improvements (性能优化)
  • test: Test additions/modifications (测试添加/修改)
  • chore: Build/tooling changes (构建/工具变更)

Reference Example / 参考示例:

Reference the example from linuxdeepin/treeland repository:

参考 linuxdeepin/treeland 仓库的示例:

fix: Correct typo in variable name from wpModle to wpModel

Fixed variable name typo throughout the codebase where "wpModle"
was incorrectly spelled instead of "wpModel". This change ensures
consistency in variable naming and improves code readability.
Additionally, temporarily disabled the smart cascaded placement
functionality by adding an early return statement for further
development.

The typo correction affects multiple workspace-related functions
including surface placement, preview management, and active surface
tracking. While the variable name change is purely cosmetic, the early
return in placeSmartCascaded indicates this feature is being reworked.

Influence:
1. Verify workspace surface management functions work correctly after
   variable name changes
2. Test surface placement and preview functionality
3. Check that active surface tracking operates as expected
4. Confirm no regression in workspace model operations

fix: 修正变量名拼写错误,将wpModle改为wpModel

修复了整个代码库中变量名拼写错误,"wpModle"被错误地拼写为"wpModel"。此更
改确保了变量命名的一致性并提高了代码可读性。此外,通过添加早期返回语句暂
时禁用了智能级联放置功能以便进一步开发。

拼写更正影响了多个工作区相关功能,包括表面放置、预览管理和活动表面跟踪。
虽然变量名称更改是纯外观上的,但placeSmartCascaded中的早期返回表明此功能
正在重新开发。

Influence:
1. 验证变量名称更改后工作区表面管理功能是否正常工作
2. 测试表面放置和预览功能
3. 检查活动表面跟踪是否按预期运行
4. 确认工作区模型操作没有回归

Implementation Details / 实现细节

  1. Create the file at path: .github/copilot-instructions.md

  2. Include clear sections for each requirement

  3. Add examples and formatting templates

  4. Explain that these are organization-wide defaults that can be supplemented by repository-specific instructions

  5. Use proper markdown formatting

  6. Include SPDX license identifier appropriate for the repository (check existing files for consistency)

  7. 在路径 .github/copilot-instructions.md 创建文件

  8. 为每个需求包含清晰的部分

  9. 添加示例和格式模板

  10. 说明这些是组织级默认设置,可以由特定仓库的指令补充

  11. 使用正确的 markdown 格式

  12. 包含适合该仓库的 SPDX 许可证标识符(检查现有文件以保持一致性)

Context / 背景

This is...

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@deepin-ci-robot
Copy link
Contributor

Hi @Copilot. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>
Copilot AI changed the title [WIP] Add organization-wide GitHub Copilot instructions docs: Add organization-wide GitHub Copilot instructions Jan 15, 2026
Copilot AI requested a review from zccrs January 15, 2026 07:38
@zccrs zccrs requested a review from BLumia January 15, 2026 07:44
@zccrs zccrs marked this pull request as ready for review January 15, 2026 07:44
@zccrs
Copy link
Member

zccrs commented Jan 15, 2026

@copilot 几个地方要纠正:

  1. 这个 copilot-instructions 文档自身不需要双语,只需要中文即可
  2. 不要固定为2026年,这个文档应该是个通用的,即便到2027年也能用,所以不应该写死2026年字样,应该用当前年份的概念代替

Co-authored-by: zccrs <13449038+zccrs@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot 几个地方要纠正:

  1. 这个 copilot-instructions 文档自身不需要双语,只需要中文即可...

已完成两项修改:

  1. 文档改为纯中文版本,移除了英文重复内容
  2. 将所有硬编码的 2026 年份替换为"当前年份"的通用概念,示例中使用 <当前年份> 占位符

提交: d172dff

@zccrs zccrs requested review from BLumia and feiguoL January 15, 2026 08:22
Copy link
Member

@BLumia BLumia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只涉及提示词,可以试下效果。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, Copilot, zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@BLumia BLumia merged commit 78a1b5f into master Jan 15, 2026
5 of 7 checks passed
@BLumia BLumia deleted the copilot/add-copilot-instructions-file branch January 15, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants