|
| 1 | +<!-- SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. |
| 2 | +SPDX-License-Identifier: GPL-3.0-or-later --> |
| 3 | + |
| 4 | +# GitHub Copilot Instructions for linuxdeepin Organization |
| 5 | +# linuxdeepin 组织的 GitHub Copilot 指导 |
| 6 | + |
| 7 | +> **Note**: These are organization-wide default instructions that apply to all repositories in the linuxdeepin organization. Individual repositories may supplement these with repository-specific instructions. |
| 8 | +> |
| 9 | +> **注意**: 这些是适用于 linuxdeepin 组织所有仓库的组织级默认指导。各个仓库可以使用特定仓库的指令来补充这些指导。 |
| 10 | +
|
| 11 | +--- |
| 12 | + |
| 13 | +## 1. Bilingual Code Review Comments / 双语代码审查评论 |
| 14 | + |
| 15 | +**Requirement**: ALL code review comments MUST be provided in BOTH English and Chinese. Never use English only. |
| 16 | + |
| 17 | +**要求**: 所有代码审查评论必须同时提供中英文双语版本。绝不能只使用英文。 |
| 18 | + |
| 19 | +### Format Template / 格式模板 |
| 20 | + |
| 21 | +``` |
| 22 | +[English comment describing the issue or suggestion] |
| 23 | +
|
| 24 | +[Chinese comment - 对问题或建议的中文描述] |
| 25 | +``` |
| 26 | + |
| 27 | +### Example / 示例 |
| 28 | + |
| 29 | +``` |
| 30 | +This function should handle null inputs to prevent potential crashes. |
| 31 | +
|
| 32 | +此函数应处理空输入以防止潜在的崩溃。 |
| 33 | +``` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## 2. SPDX Copyright Header Validation / SPDX 版权头验证 |
| 38 | + |
| 39 | +**Requirement**: When reviewing code changes, automatically check SPDX copyright headers for proper date formatting. |
| 40 | + |
| 41 | +**要求**: 在审查代码更改时,自动检查 SPDX 版权头的日期格式是否正确。 |
| 42 | + |
| 43 | +### Required Format / 所需格式 |
| 44 | + |
| 45 | +```cpp |
| 46 | +// SPDX-FileCopyrightText: YYYY[-YYYY] UnionTech Software Technology Co., Ltd. |
| 47 | +// SPDX-License-Identifier: <appropriate-license> |
| 48 | +``` |
| 49 | + |
| 50 | +For other file types (e.g., CMake, Python, Shell scripts): |
| 51 | +对于其他文件类型(如 CMake、Python、Shell 脚本): |
| 52 | + |
| 53 | +```cmake |
| 54 | +# SPDX-FileCopyrightText: YYYY[-YYYY] UnionTech Software Technology Co., Ltd. |
| 55 | +# SPDX-License-Identifier: <appropriate-license> |
| 56 | +``` |
| 57 | + |
| 58 | +### Validation Rules / 验证规则 |
| 59 | + |
| 60 | +#### For New Files / 对于新文件 |
| 61 | + |
| 62 | +- **MUST** include SPDX header with current year (2026) |
| 63 | +- **必须**包含带有当前年份 (2026) 的 SPDX 头 |
| 64 | + |
| 65 | +**Example / 示例:** |
| 66 | +```cpp |
| 67 | +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. |
| 68 | +// SPDX-License-Identifier: GPL-3.0-or-later |
| 69 | +``` |
| 70 | + |
| 71 | +#### For Modified Files / 对于修改的文件 |
| 72 | + |
| 73 | +**Case 1**: File created in the same year as modification → Use single year format |
| 74 | +**情况 1**: 文件在与修改相同的年份创建 → 使用单年份格式 |
| 75 | + |
| 76 | +```cpp |
| 77 | +// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. |
| 78 | +``` |
| 79 | + |
| 80 | +**Case 2**: File created in an earlier year → Use year range format (YYYY-YYYY) |
| 81 | +**情况 2**: 文件在更早的年份创建 → 使用年份范围格式 (YYYY-YYYY) |
| 82 | + |
| 83 | +- First YYYY = file creation year / 第一个 YYYY = 文件创建年份 |
| 84 | +- Second YYYY = last modification year / 第二个 YYYY = 最后修改年份 |
| 85 | + |
| 86 | +```cpp |
| 87 | +// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd. |
| 88 | +``` |
| 89 | + |
| 90 | +**Important**: Only use range format (YYYY-YYYY) when the years differ. If they are the same, use single year format. |
| 91 | + |
| 92 | +**重要**: 只有当年份不同时才使用范围格式 (YYYY-YYYY)。如果年份相同,使用单年份格式。 |
| 93 | + |
| 94 | +### What to Check / 检查内容 |
| 95 | + |
| 96 | +Remind developers if / 提醒开发者如果: |
| 97 | + |
| 98 | +1. ❌ New files are missing SPDX headers |
| 99 | + - 新文件缺少 SPDX 头 |
| 100 | + |
| 101 | +2. ❌ New files have incorrect year (not 2026) |
| 102 | + - 新文件的年份不正确(不是 2026) |
| 103 | + |
| 104 | +3. ❌ Modified files have not updated the year to current year (2026) |
| 105 | + - 修改的文件未将年份更新为当前年份 (2026) |
| 106 | + |
| 107 | +### Review Comment Example / 审查评论示例 |
| 108 | + |
| 109 | +``` |
| 110 | +Please update the SPDX copyright header to include the current year. Since this file |
| 111 | +was created in 2023 and is being modified in 2026, it should use the year range format: |
| 112 | +// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd. |
| 113 | +
|
| 114 | +请更新 SPDX 版权头以包含当前年份。由于此文件创建于 2023 年并在 2026 年被修 |
| 115 | +改,应使用年份范围格式: |
| 116 | +// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd. |
| 117 | +``` |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## 3. Bilingual Commit Message Format / 双语提交消息格式 |
| 122 | + |
| 123 | +**Requirement**: All commit messages generated by Copilot MUST follow the bilingual format below. |
| 124 | + |
| 125 | +**要求**: 所有由 Copilot 生成的提交消息都必须遵循以下双语格式。 |
| 126 | + |
| 127 | +### Template / 模板 |
| 128 | + |
| 129 | +``` |
| 130 | +<type>: <English summary> |
| 131 | +
|
| 132 | +<English detailed description> |
| 133 | +- Key change 1 |
| 134 | +- Key change 2 |
| 135 | +
|
| 136 | +Influence: |
| 137 | +1. <Impact point 1> |
| 138 | +2. <Impact point 2> |
| 139 | +3. <Testing recommendation> |
| 140 | +
|
| 141 | +<type>: <中文摘要> |
| 142 | +
|
| 143 | +<中文详细描述> |
| 144 | +- 关键变更 1 |
| 145 | +- 关键变更 2 |
| 146 | +
|
| 147 | +Influence: |
| 148 | +1. <影响点 1> |
| 149 | +2. <影响点 2> |
| 150 | +3. <测试建议> |
| 151 | +``` |
| 152 | + |
| 153 | +### Commit Types / 提交类型 |
| 154 | + |
| 155 | +| Type | Description (English) | 描述 (中文) | |
| 156 | +|------|----------------------|------------| |
| 157 | +| `feat` | New feature | 新功能 | |
| 158 | +| `fix` | Bug fix | 问题修复 | |
| 159 | +| `docs` | Documentation changes | 文档更改 | |
| 160 | +| `style` | Code style/formatting | 代码风格/格式化 | |
| 161 | +| `refactor` | Code refactoring | 代码重构 | |
| 162 | +| `perf` | Performance improvements | 性能优化 | |
| 163 | +| `test` | Test additions/modifications | 测试添加/修改 | |
| 164 | +| `chore` | Build/tooling changes | 构建/工具变更 | |
| 165 | + |
| 166 | +### Complete Example / 完整示例 |
| 167 | + |
| 168 | +Reference from linuxdeepin/treeland repository: |
| 169 | +参考来自 linuxdeepin/treeland 仓库: |
| 170 | + |
| 171 | +``` |
| 172 | +fix: Correct typo in variable name from wpModle to wpModel |
| 173 | +
|
| 174 | +Fixed variable name typo throughout the codebase where "wpModle" |
| 175 | +was incorrectly spelled instead of "wpModel". This change ensures |
| 176 | +consistency in variable naming and improves code readability. |
| 177 | +Additionally, temporarily disabled the smart cascaded placement |
| 178 | +functionality by adding an early return statement for further |
| 179 | +development. |
| 180 | +
|
| 181 | +The typo correction affects multiple workspace-related functions |
| 182 | +including surface placement, preview management, and active surface |
| 183 | +tracking. While the variable name change is purely cosmetic, the early |
| 184 | +return in placeSmartCascaded indicates this feature is being reworked. |
| 185 | +
|
| 186 | +Influence: |
| 187 | +1. Verify workspace surface management functions work correctly after |
| 188 | + variable name changes |
| 189 | +2. Test surface placement and preview functionality |
| 190 | +3. Check that active surface tracking operates as expected |
| 191 | +4. Confirm no regression in workspace model operations |
| 192 | +
|
| 193 | +fix: 修正变量名拼写错误,将wpModle改为wpModel |
| 194 | +
|
| 195 | +修复了整个代码库中变量名拼写错误,"wpModle"被错误地拼写为"wpModel"。此更 |
| 196 | +改确保了变量命名的一致性并提高了代码可读性。此外,通过添加早期返回语句暂 |
| 197 | +时禁用了智能级联放置功能以便进一步开发。 |
| 198 | +
|
| 199 | +拼写更正影响了多个工作区相关功能,包括表面放置、预览管理和活动表面跟踪。 |
| 200 | +虽然变量名称更改是纯外观上的,但placeSmartCascaded中的早期返回表明此功能 |
| 201 | +正在重新开发。 |
| 202 | +
|
| 203 | +Influence: |
| 204 | +1. 验证变量名称更改后工作区表面管理功能是否正常工作 |
| 205 | +2. 测试表面放置和预览功能 |
| 206 | +3. 检查活动表面跟踪是否按预期运行 |
| 207 | +4. 确认工作区模型操作没有回归 |
| 208 | +``` |
| 209 | + |
| 210 | +--- |
| 211 | + |
| 212 | +## Summary / 总结 |
| 213 | + |
| 214 | +These instructions ensure that: |
| 215 | +这些指导确保: |
| 216 | + |
| 217 | +1. ✅ All code reviews are accessible to both English and Chinese speakers |
| 218 | + - 所有代码审查对英语和中文使用者都易于理解 |
| 219 | + |
| 220 | +2. ✅ Copyright headers are properly maintained and up-to-date |
| 221 | + - 版权头得到正确维护并保持最新 |
| 222 | + |
| 223 | +3. ✅ Commit messages provide comprehensive context in both languages |
| 224 | + - 提交消息以两种语言提供全面的上下文 |
| 225 | + |
| 226 | +By following these guidelines, we maintain consistency and clarity across all linuxdeepin projects. |
| 227 | +通过遵循这些指导,我们在所有 linuxdeepin 项目中保持一致性和清晰度。 |
0 commit comments