@chengzhao-dev/dsh-cpp-workflow 0.7.9 → 0.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.en.md +8 -7
  2. package/README.md +5 -4
  3. package/cordis.patch.yml +2 -2
  4. package/icon.svg +5 -5
  5. package/lib/client.js +542 -538
  6. package/lib/comment-policy.js +37 -33
  7. package/lib/workspace.js +8 -10
  8. package/locale/en.json +4 -4
  9. package/locale/zh.json +4 -4
  10. package/package.json +100 -100
  11. package/skills/building-cpp/SKILL.md +5 -5
  12. package/skills/building-cpp/assets/config/.clang-tidy +4 -5
  13. package/skills/building-cpp/assets/config/.clangd +5 -7
  14. package/skills/building-cpp/assets/config/.vscode/extensions.json +5 -5
  15. package/skills/building-cpp/assets/config/.vscode/settings.json +56 -58
  16. package/skills/building-cpp/examples/environment.md +13 -102
  17. package/skills/building-cpp/references/01-build-script.md +3 -3
  18. package/skills/building-cpp/references/02-environment.md +8 -8
  19. package/skills/building-cpp/scripts/checking-environment.mjs +424 -424
  20. package/skills/building-cpp/steps/01-build.md +10 -10
  21. package/skills/building-cpp/steps/02-tooling.md +6 -6
  22. package/skills/building-cpp/steps/03-check.md +2 -2
  23. package/skills/building-cpp/steps/04-vscode.md +4 -6
  24. package/skills/developing-cpp/SKILL.md +8 -9
  25. package/skills/developing-cpp/references/comments/01-comment-rules.md +50 -26
  26. package/skills/developing-cpp/references/comments/02-style.md +33 -25
  27. package/skills/developing-cpp/references/comments/examples/03-declaration-enum.md +14 -14
  28. package/skills/developing-cpp/references/comments/examples/04-declaration-file.md +12 -8
  29. package/skills/developing-cpp/references/comments/examples/05-declaration-function.md +20 -10
  30. package/skills/developing-cpp/references/comments/examples/06-declaration-member.md +4 -4
  31. package/skills/developing-cpp/references/comments/examples/07-declaration-predicate.md +2 -2
  32. package/skills/developing-cpp/references/comments/examples/08-declaration-struct.md +6 -6
  33. package/skills/developing-cpp/references/comments/examples/09-implementation-body.md +41 -41
  34. package/skills/developing-cpp/references/comments/glossary/01-comment-terms.md +17 -16
  35. package/skills/developing-cpp/references/design/01-project-design.md +21 -10
  36. package/skills/developing-cpp/references/design/02-raii.md +5 -4
  37. package/skills/developing-cpp/references/design/03-third-party.md +2 -2
  38. package/skills/developing-cpp/references/design/examples/02-coordinate-table.md +12 -12
  39. package/skills/developing-cpp/references/design/examples/03-header-place.md +1 -1
  40. package/skills/developing-cpp/references/design/examples/04-library-boundary.md +6 -6
  41. package/skills/developing-cpp/references/design/examples/06-move-result.md +29 -28
  42. package/skills/developing-cpp/references/design/examples/07-preview-read.md +24 -23
  43. package/skills/developing-cpp/references/design/examples/08-screen-enter-exit.md +19 -18
  44. package/skills/developing-cpp/references/design/examples/09-option-menu.md +6 -6
  45. package/skills/developing-cpp/references/design/session-layer.md +13 -22
  46. package/skills/developing-cpp/references/exceptions/01-exception-rules.md +57 -57
  47. package/skills/developing-cpp/references/exceptions/examples/01-throw-boundary.md +7 -20
  48. package/skills/developing-cpp/references/exceptions/examples/02-throw-build-mode.md +10 -11
  49. package/skills/developing-cpp/references/exceptions/examples/03-throw-catch.md +4 -4
  50. package/skills/developing-cpp/references/exceptions/examples/04-throw-destructor.md +9 -5
  51. package/skills/developing-cpp/references/exceptions/examples/07-throw-when.md +2 -2
  52. package/skills/developing-cpp/references/index.md +32 -35
  53. package/skills/developing-cpp/references/language/glossary/01-language-terms.md +3 -2
  54. package/skills/developing-cpp/references/language/language-basics/02-initialization.md +1 -1
  55. package/skills/developing-cpp/references/language/language-basics/05-expressions.md +9 -2
  56. package/skills/developing-cpp/references/language/language-basics/06-functions.md +2 -3
  57. package/skills/developing-cpp/references/language/language-basics/09-templates.md +3 -3
  58. package/skills/developing-cpp/references/language/language-basics/10-language-checklist.md +9 -9
  59. package/skills/developing-cpp/references/language/performance/03-memory.md +1 -1
  60. package/skills/developing-cpp/references/language/performance/07-checklist.md +6 -6
  61. package/skills/developing-cpp/references/language/standard-library/01-containers.md +4 -5
  62. package/skills/developing-cpp/references/language/standard-library/02-access.md +2 -5
  63. package/skills/developing-cpp/references/language/standard-library/05-string.md +1 -1
  64. package/skills/developing-cpp/references/language/standard-library/06-format.md +22 -20
  65. package/skills/developing-cpp/references/language/standard-library/{11-format-ecosystem.md → 07-format-ecosystem.md} +2 -11
  66. package/skills/developing-cpp/references/language/standard-library/{07-time.md → 08-time.md} +1 -1
  67. package/skills/developing-cpp/references/language/standard-library/{09-files.md → 10-files.md} +1 -1
  68. package/skills/developing-cpp/references/language/standard-library/11-library-checklist.md +8 -0
  69. package/skills/developing-cpp/references/language/value-types/02-signed.md +7 -7
  70. package/skills/developing-cpp/references/language/value-types/03-integer-roles.md +14 -2
  71. package/skills/developing-cpp/references/language/value-types/05-strong-type.md +2 -2
  72. package/skills/developing-cpp/references/language/value-types/06-const-method.md +5 -5
  73. package/skills/developing-cpp/references/language/value-types/07-nodiscard.md +1 -1
  74. package/skills/developing-cpp/references/language/value-types/08-comparison.md +1 -1
  75. package/skills/developing-cpp/references/language/value-types/09-subscript.md +1 -1
  76. package/skills/developing-cpp/references/language/value-types/11-checklist.md +7 -7
  77. package/skills/developing-cpp/references/layout/01-source-layout.md +13 -13
  78. package/skills/developing-cpp/references/layout/02-file-template.md +10 -10
  79. package/skills/developing-cpp/references/layout/03-declaration-order.md +83 -42
  80. package/skills/developing-cpp/references/naming/01-identifier-names.md +32 -30
  81. package/skills/developing-cpp/references/naming/examples/06-naming-lower-layer.md +15 -15
  82. package/skills/developing-cpp/references/naming/examples/07-naming-multiple-return.md +2 -2
  83. package/skills/developing-cpp/references/naming/examples/13-naming-state-change.md +24 -23
  84. package/skills/developing-cpp/references/naming/glossary/01-naming-terms.md +3 -3
  85. package/skills/developing-cpp/references/naming/glossary/02-position.md +9 -9
  86. package/skills/developing-cpp/references/naming/glossary/03-selection.md +5 -1
  87. package/skills/developing-cpp/references/naming/glossary/04-square.md +3 -3
  88. package/skills/developing-cpp/references/naming/glossary/05-scoring.md +2 -2
  89. package/skills/developing-cpp/references/naming/glossary/06-difficulty.md +7 -7
  90. package/skills/developing-cpp/references/naming/glossary/07-stream.md +1 -1
  91. package/skills/developing-cpp/references/style/01-google-cpp-style.md +13 -23
  92. package/skills/developing-cpp/scripts/checking-comments.mjs +961 -755
  93. package/skills/developing-cpp/scripts/checking-declaration-order.mjs +512 -515
  94. package/skills/developing-cpp/steps/01-behavior.md +0 -1
  95. package/skills/developing-cpp/steps/02-boundary.md +2 -3
  96. package/skills/developing-cpp/steps/03-declaration.md +9 -10
  97. package/skills/developing-cpp/steps/04-implementation.md +7 -8
  98. package/skills/engineering/SKILL.md +9 -10
  99. package/skills/engineering/references/cmake/assets/LinkSettings.cmake +1 -1
  100. package/skills/engineering/references/cmake/linking/02-rpath.md +5 -6
  101. package/skills/engineering/references/cmake/modules/01-functions.md +9 -9
  102. package/skills/engineering/references/cmake/standards/01-cxx-standard.md +6 -6
  103. package/skills/engineering/references/cmake/standards/index.md +8 -29
  104. package/skills/engineering/references/cmake/targets/01-target-rules.md +14 -13
  105. package/skills/engineering/references/cmake/targets/examples/01-rpath.md +1 -1
  106. package/skills/engineering/references/cmake/testing/01-ctest.md +3 -3
  107. package/skills/engineering/references/formatting/01-encoding.md +5 -5
  108. package/skills/engineering/references/formatting/02-clang-format.md +2 -2
  109. package/skills/engineering/references/formatting/03-clang-tidy.md +5 -5
  110. package/skills/engineering/references/formatting/04-clangd.md +32 -39
  111. package/skills/engineering/references/formatting/05-config-comments.md +88 -0
  112. package/skills/engineering/references/formatting/examples/02-clang-tidy.md +6 -6
  113. package/skills/engineering/references/formatting/examples/03-clangd.md +17 -17
  114. package/skills/engineering/references/index.md +5 -4
  115. package/skills/engineering/scripts/checking-encoding.mjs +369 -369
  116. package/skills/engineering/steps/01-targets.md +3 -3
  117. package/skills/engineering/steps/02-modules.md +1 -2
  118. package/skills/engineering/steps/03-check.md +2 -3
  119. package/templates/cpp-workflow-project/SKILL.md +1 -1
  120. package/templates/cpp-workflow-project/environment.json +4 -4
  121. package/skills/developing-cpp/references/design/examples/05-library-split.md +0 -8
  122. package/skills/developing-cpp/references/language/standard-library/10-library-checklist.md +0 -10
  123. package/skills/developing-cpp/references/naming/examples/02-naming-basic.md +0 -4
  124. package/skills/developing-cpp/references/naming/examples/10-naming-rename.md +0 -6
  125. package/skills/engineering/references/formatting/examples/04-config-comments.md +0 -70
  126. /package/skills/developing-cpp/references/language/standard-library/{08-random.md → 09-random.md} +0 -0
@@ -24,7 +24,7 @@ target 规则:
24
24
  - 源文件显式列出;不写 `file(GLOB ...)`,新增文件时改 CMake。
25
25
  - `set(CMAKE_EXPORT_COMPILE_COMMANDS ON)`;可执行文件输出到 `build/<compiler>/bin`,库到 `build/<compiler>/lib`。
26
26
  - 需要直接运行构建产物的共享库程序,调用 `set_target_build_rpath(app)`;函数在 Linux 写 `$ORIGIN/../lib`,Apple 写 `@loader_path/../lib`。
27
- - 标准用工程根 `cmake/` 里的 `set_target_cxx_standard(target visibility c++NN)`;模板为了脱离插件可直接复制而内联三属性,复制进工程后应改回函数。没有这个函数时先从 `../references/cmake/assets/CompileSettings.cmake` 复制到工程根 `cmake/` 并导入,不要在每个 target 重复三属性。需要 `set_target_build_rpath` 或 `fetch_googletest` 时,把同目录的 `LinkSettings.cmake` 一并复制并 `include(LinkSettings)`。
27
+ - 标准用工程根 `cmake/` 里的 `set_target_cxx_standard(target visibility c++NN)`;模板为了脱离插件可直接复制而内联三属性与 RPATH 分支,复制进工程后应改回函数。没有这个函数时先从 `../references/cmake/assets/CompileSettings.cmake` 复制到工程根 `cmake/` 并导入,不要在每个 target 重复三属性。需要 `set_target_build_rpath` 或 `fetch_googletest` 时,把同目录的 `LinkSettings.cmake` 一并复制并 `include(LinkSettings)`。
28
28
  - 警告用同一份 `CompileSettings.cmake` 里的 `set_target_warnings(target visibility LEVEL basic|standard|strict)`;`visibility` 用 `PRIVATE` 或 `INTERFACE`,不要在每个 target 重复 `-Wall` 列表。
29
29
 
30
30
  ## 命令形状
@@ -33,13 +33,13 @@ configure 的目录与编译器写法以 `building-cpp` 的 `steps/01-build.md`
33
33
 
34
34
  ## 情况
35
35
 
36
- **新工程**:工程模板仍由 `building-cpp` 提供,从 `../../building-cpp/assets/templates/projects/` 选形态,只复制目标工程缺的文件;模板里的三属性只是可运行的最小形状,接管时按本节换成 `set_target_cxx_standard`;警告与 `-Werror` 由 `set_target_warnings` 按需打开,模板不默认加;模板里的 `{{PROJECT_NAME}}` 换成真实工程名,再按本节改 target 与标准。
36
+ **新工程**:工程模板仍由 `building-cpp` 提供,从 `../../building-cpp/assets/templates/projects/` 选形态,只复制目标工程缺的文件;模板里的三属性只是可运行的最小形状,接管时按本节换成 `set_target_cxx_standard`;RPATH 分支同时换成 `set_target_build_rpath(app)`;警告与 `-Werror` 由 `set_target_warnings` 按需打开,模板不默认加;模板里的 `{{PROJECT_NAME}}` 换成真实工程名,再按本节改 target 与标准。
37
37
 
38
38
  **已有工程**:先读现有 `CMakeLists.txt`,找出全局设置、GLOB、输出目录和 target 命名;只改与当前任务相关的一处。大改前先让现有构建跑通,保留可回退点。
39
39
 
40
40
  **库 + 程序**:库的公共 include 用 `PUBLIC` 传播;程序不直接包含库的 `src/`。静态库与动态库的 target 写法相同,动态库额外设运行时路径。
41
41
 
42
- **测试**:确有第二个消费者时再加 `enable_testing()` 与 `add_subdirectory(tests)`;测试 target 用 `fetch_googletest()` 取固定版本框架,并用 `gtest_discover_tests(<target> DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit TIMEOUT 10)` 注册;不得用 `add_test(NAME all ...)` 包整个可执行文件。测试 target 只链接被测库的公共接口,没有测试时不加空测试。
42
+ **测试**:确有第二个消费者时再加 `enable_testing()` 与 `add_subdirectory(tests)`;测试 target 用 `fetch_googletest()` 取固定版本框架,用 `include(GoogleTest)` 加 `gtest_discover_tests` 注册,命令参数以 `../references/cmake/testing/01-ctest.md`「注册给 CTest」为唯一出处;不得用 `add_test(NAME all ...)` 包整个可执行文件。测试 target 只链接被测库的公共接口,没有测试时不加空测试。
43
43
 
44
44
  **预设**:使用 preset 时名称固定 `clang` / `gcc`,与构建目录一致;没有 preset 时直接用上面的命令,不要两套并存。
45
45
 
@@ -23,8 +23,7 @@
23
23
 
24
24
  ## 契约
25
25
 
26
- - 公开函数上方写官方文档块:`#[=======================================================================[.rst:` 开头,模块名与 `---` 标题线,命令用 `.. command::`,签名用 `.. code-block:: cmake`,块内散文写中文。
27
- - 完整写法见 `../references/cmake/targets/01-target-rules.md`;签名留在 `function()` 那一行。
26
+ - 公开函数上方写官方文档块,签名留在 `function()` 那一行;文档块形态与排版只按 `../references/cmake/targets/01-target-rules.md` 的「排版」节写,本步不复制第二份。
28
27
  - 签名、警告等级与错误消息以 `../references/cmake/assets/` 和 `../references/cmake/modules/01-functions.md` 为准;本步不复制第二份。
29
28
  - 普通函数只改传入 target 的属性,不写全局变量、不读环境变量、不下载依赖;唯一例外是 `fetch_googletest`,只在测试需要时调用。
30
29
  - 先校验 target、可见性与标准,再调用 `target_*` 或 `set_target_properties`;失败用 `FATAL_ERROR`,消息带函数名与非法值。
@@ -13,11 +13,10 @@ configure 与构建的完整命令(Ninja、编译器、`CMAKE_EXPORT_COMPILE_C
13
13
  下文 `<构建目录>` 取项目技能声明的单一构建目录(如 `games/<game>/build`),没声明时用 `build/<compiler>`;`<程序 target>` 取项目技能「程序 target」字段,模板默认 `app`。
14
14
 
15
15
  - **target 图**:`<程序 target>` 链接库,库的公共 include 用 `PUBLIC`;没有把 `main()` 编进库。
16
- - **标准**:读 `<构建目录>/compile_commands.json` 中每个 target 的 `-std=`;每个 target 只能有一条,必须与 `environment.json` 的 `standard` 一致,不能是 `gnu++NN` 或更高默认标准,不同值即失败。
16
+ - **标准**:读 `<构建目录>/compile_commands.json` 中每条 `-std=`;同一 target 的各条取值必须相同,且都等于 `environment.json` 的 `standard`,不能是 `gnu++NN` 或更高默认标准,出现不同值即失败。
17
17
  - **没有全局污染**:全仓搜索 `include_directories`、`add_definitions`、`CMAKE_CXX_FLAGS`、`file(GLOB`,命中就回第 1 步。
18
18
  - **模块导入**:根 `CMakeLists.txt` 只导入一次;函数名与文件名可追溯;删除旧模块后没有残留 `include()`。
19
- - **排版**:`CMakeLists.txt` 与 `*.cmake` 缩进用 4 个空格,行内对齐也用空格,UTF-8 无 BOM、LF;抽查 120 列(中文按 2 列计)以上的行是否有必要。
20
- - **文档块**:每个模块文件开头有 `#[=` 文档块与 `.. command::`,块内散文写中文,签名留在 `function()` 那一行。
19
+ - **排版与文档块**:`CMakeLists.txt` 与 `*.cmake` 的缩进、编码、行宽按 `../references/cmake/targets/01-target-rules.md` 的「排版」节抽查;每个模块文件开头有文档块,签名留在 `function()` 那一行。
21
20
  - **产物位置**:可执行文件在 `<构建目录>/bin`,库在 `<构建目录>/lib`;源码目录没有新增构建产物。
22
21
  - **产物可加载**:对 `<构建目录>/bin/<程序 target>` 跑 `file` 与 `ldd`(macOS 用 `otool -L`),不得出现 `not found`;出现缺失按 RPATH 回第 1 步。启动检查由 `building-cpp` 的入口命令负责。见 `../references/cmake/linking/04-inspect.md`。
23
22
 
@@ -66,7 +66,7 @@ metadata:
66
66
 
67
67
  ## 编辑器补全
68
68
 
69
- - clangd 提供补全、跳转和诊断;`.clangd` 指向 `build/<compiler>` 的编译数据库,不写 `-std`。
69
+ - clangd 提供补全、跳转和诊断;`.clangd` 指向项目技能声明的构建目录:单一目录写该目录,多编译器写 `build/<compiler>`;不写 `-std`。
70
70
  - `--query-driver` 放在 `.vscode/settings.json` 的 `clangd.arguments`,不要写成 `.clangd` 的 YAML 键。
71
71
  - 编辑器内的配置、构建与调试从 CMake Tools 进入,命令行与 CI 一律走入口命令;两者共用同一构建目录;C/C++ 扩展只做 `CMake: Debug` 的后端,IntelliSense 关闭。
72
72
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "host": "",
3
- "build_host": "",
4
- "compiler": "",
5
- "standard": "c++23"
2
+ "host": "",
3
+ "build_host": "",
4
+ "compiler": "",
5
+ "standard": "c++23"
6
6
  }
@@ -1,8 +0,0 @@
1
- <!-- 读取时机:看设计案例时;读完能回答:正反例:单文件何时拆库;预算:一次只开这一份(7 行),不自动串联。 -->
2
- # 正反例:单文件何时拆库
3
-
4
- **先不拆**:一个 `main.cpp`,辅助函数在匿名命名空间,只有程序自己用。
5
-
6
- **该拆**:测试需要直接调用排序逻辑;或第二个程序要复用同一逻辑;或逻辑已经超过一个屏幕。
7
-
8
- 拆的时候先定公共头(只暴露 `SortedByPriority`),把实现移到 `src/`,行为句不变,测试先绿再改构建。
@@ -1,10 +0,0 @@
1
- <!-- 读取时机:查语言细节时;读完能回答:检查清单;预算:一次只开这一份(9 行),不自动串联。 -->
2
- # 检查清单
3
-
4
- - [ ] 容器选择有明确理由,默认是 `vector`。
5
- - [ ] 访问前有边界证明,或使用 `at`。
6
- - [ ] 没有保存 `string_view` / `span` 指向的临时对象。
7
- - [ ] 修改容器大小前处理了迭代器失效。
8
- - [ ] 能用算法表达时没有手写下标循环。
9
- - [ ] 输出方式见 `references/language/standard-library/06-format.md`。
10
- - [ ] 自定义类型的 formatter 只接受默认格式,非法枚举有稳定回退,输出可直接用 `std::format` 断言。
@@ -1,4 +0,0 @@
1
- <!-- 读取时机:命名示例时;读完能回答:正反例:基本规则;预算:一次只开这一份(3 行),不自动串联。 -->
2
- # 正反例:基本规则
3
-
4
- 大小写、前缀与成员尾随 `_` 的规则表见 `references/naming/01-identifier-names.md`;下面只收需要语境才能判断的例子。
@@ -1,6 +0,0 @@
1
- <!-- 读取时机:命名示例时;读完能回答:正反例:改名检查;预算:一次只开这一份(5 行),不自动串联。 -->
2
- # 正反例:改名检查
3
-
4
- - 搜全部调用点:声明、定义、测试、注释、文档。
5
- - 先改声明,再改定义,再改调用点;每一步都能编译。
6
- - 公共 API 改名保留旧名转发时,注释写弃用期限;不要静默删除。
@@ -1,70 +0,0 @@
1
- <!-- 读取时机:写或改配置文件注释、判注释句式时;读完能回答:正反例:配置文件注释;预算:一次只开这一份(69 行),不自动串联。 -->
2
- # 正反例:配置文件注释
3
-
4
- `runtime.config` 这类运行时配置一个键一项,注释规则见下节;句式与语言无关,下面用 TOML 举例。`.clang-format`、`.clang-tidy`、`.clangd`、`.editorconfig` 与 `.vscode/` 的固定值配置按 `developing-cpp` 的 `references/comments/02-style.md` 写。
5
-
6
- ## 键注释
7
-
8
- **好**(完整文件):
9
-
10
- ```toml
11
- # 本仓 Python 与 Quarto 的运行时配置。
12
- #
13
- # 定义解释器路径、Python 与 Quarto 的最低版本。
14
-
15
- # =================================== Python ===================================
16
-
17
- # Python 解释器的完整路径:解释器不存在或不可执行时,检查脚本报错退出。
18
- python_path = "D:/ProgramData/miniforge3/python.exe"
19
-
20
- # Python 解释器的最低版本:解释器版本低于此值时,检查脚本报错退出。
21
- python_min_version = "3.12"
22
-
23
- # =================================== Quarto ===================================
24
-
25
- # Quarto 的最低版本:已安装的 Quarto 低于此值时,检查脚本报错退出。
26
- quarto_min_version = "1.10.19"
27
- ```
28
-
29
- 句式「对象:条件时,后果。」:对象与键名对得上,条件写清比较对象,后果写清谁报错、报什么;同类键取同一句式,便于并排核对。
30
-
31
- **差**:
32
-
33
- ```toml
34
- # python 路径
35
- python_path = "D:/ProgramData/miniforge3/python.exe"
36
- # 版本低于此值时报错退出
37
- quarto_min_version = "1.10.19"
38
- ```
39
-
40
- 第一条复述键名;第二条没有比较对象与执行者。`sed` 取值、CI 步骤这类实现细节同样不写进注释:注释给的是读者要遵守的契约与违反后的后果。
41
-
42
- ## 注释语法
43
-
44
- - TOML 配置只有 `#` 一种注释;`#` 后空一格,句末用句号。
45
- - 注释紧贴键的上一行,键与注释之间不空行;不写行尾注释。
46
- - 键块(注释 + 键)内部不空行,键块之间空一行。
47
- - 文件有两个及以上对象时,每区第一行写一行 80 列等号横幅,标题居中,前后各空一行;`.editorconfig` 的横幅紧贴其下的节头,节按文件后缀分组,不按本仓目录命名。
48
- - 数组键(用到时):键名后换行,一项一行,收尾 `]` 顶格;不给数组项加行尾注释。
49
-
50
- ## 抬头
51
-
52
- 标题不是必需:需要交代文件整体用途时写一行标题,第二行写 `#`,其后一到两行写文件内容或例外(本技能的 `.clang-format` 资产只有标题、`#` 与一行用途);只写内容,不写取舍理由、工具来源与跨文件关系;动词按文件性质取(定义、规定、约定),不要求统一用「定义」;本例的 `runtime.config` 写全三行。
53
-
54
- ## 模板
55
-
56
- 新建运行时配置时按下面的骨架写,替换尖括号内容;键名与取值按项目实际,分组与句式不变;多对象时按正例加区域横幅,等号补到 80 列。第三行的动词按「抬头」一节取,骨架用「定义」只是示例。模板只示意标量键,用到数组键时按「注释语法」末条写。标题按「抬头」一节的判断保留或删除。
57
-
58
- ```text
59
- # <项目>的运行时配置。
60
- #
61
- # 定义<条目>。
62
-
63
- # ============================== <对象> ==============================
64
-
65
- # <对象>:<条件>时,<执行者>报错退出。
66
- <键> = "<值>"
67
-
68
- # <对象>:<条件>时,<执行者>报错退出。
69
- <键> = "<值>"
70
- ```