iter41-收尾:实现报告+反哺点清单落reports(键账对拍/豁免申报/测试移交清单/architecture现状改写申请/GDD行号随动)+并master文档面同步(art-bible成文整备/README能力清单)
This commit is contained in:
1 parent
b31d7de8b6
commit
b5cf393170
16 files changed
+663
-435
No files matched your search
@@ -23,8 +23,8 @@ r"""doc_link_audit.py — design 文档链接健康检查
|
||||
python tools/doc_link_audit.py <file.md> ... # 只扫指定文件
|
||||
python tools/doc_link_audit.py --json # 机器可读
|
||||
|
||||
口径:只扫 design/gdd/——design/art、reports/
|
||||
(历史素材/提案)不在扫描域,但作为链接目标被校验。排除 ``` 围栏代码块与 ; 开头注释行。
|
||||
口径:扫 design/gdd/ 与 design/art/(2026-10-28 美术族成文整备批收编)——reports/
|
||||
(提案过程件)不在扫描域,但作为链接目标被校验。排除 ``` 围栏代码块与 ; 开头注释行。
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
@@ -32,7 +32,7 @@ import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
DEFAULT_DIRS = ["design/gdd"]
|
||||
DEFAULT_DIRS = ["design/gdd", "design/art"]
|
||||
PROTO_PREFIX = "game"
|
||||
|
||||
ALLOWED_EXTS = ("md", "yaml", "yml", "tres", "gd", "py", "json", "csv")
|
||||
|
||||
+19
-1
@@ -2,7 +2,7 @@
|
||||
r"""gdd_lint.py — GDD lean 格式门禁
|
||||
|
||||
用法:
|
||||
python tools/gdd_lint.py # 检查 design/gdd/ 根层 GDD + roadmap.md(默认范围)
|
||||
python tools/gdd_lint.py # 检查 design/gdd/ 根层 GDD + design/art/ + roadmap.md(默认范围)
|
||||
python tools/gdd_lint.py --changelog-only # 只跑 R4 变更记录节禁令,扫描面扩到全 design/ 树
|
||||
python tools/gdd_lint.py <file.md> ... # 检查指定文件
|
||||
python tools/gdd_lint.py --json # 机器可读输出(供 gate/CI 使用)
|
||||
@@ -45,6 +45,13 @@ RULE_EXEMPT = {
|
||||
"术语表.md": {"R5"},
|
||||
}
|
||||
|
||||
# 美术域收编(2026-10-28 美术族成文整备批):design/art/ 为高密度规格/清单/提示词操作单体裁,
|
||||
# 体裁类规则(R1 段长/R5 流程图/R7 括号跨度/R8 规则表/R9 节点行数)不适用、豁免防误报;
|
||||
# R11 的锚表是 GDD 行协议/格面资源专属计数,对美术域同样不适用。
|
||||
# 跨体裁有效面照常执法:R3 修订注记、R4 变更记录节、R6 表格列数。
|
||||
ART_DOMAIN_EXEMPT = {"R1", "R5", "R7", "R8", "R9", "R11"}
|
||||
ART_DIR = "design/art"
|
||||
|
||||
DEFAULT_DIR = "design/gdd"
|
||||
DEFAULT_EXCLUDE = {"game-concept.md", "game-pillars.md", "systems-index.md"}
|
||||
# R4 变更记录节标题(2026-10-19 用户裁「沿革只进 git」——原「必须有版本历史节」反转为此禁令,
|
||||
@@ -171,7 +178,11 @@ def lint_file(path):
|
||||
# R1 段落长度
|
||||
fname = Path(path).name
|
||||
ex = RULE_EXEMPT.get(fname, set()) # 规则粒度分域豁免(见 RULE_EXEMPT 注)
|
||||
if str(path).replace("\\", "/").startswith(ART_DIR.replace("\\", "/") + "/"):
|
||||
ex = ex | ART_DOMAIN_EXEMPT
|
||||
for p in paras:
|
||||
if "R1" in ex:
|
||||
break
|
||||
if len(p) > MAX_PARA:
|
||||
issues.append(f"R1 散文段 {len(p)} 字(>{MAX_PARA}): {p[:50]}…")
|
||||
|
||||
@@ -249,6 +260,7 @@ def lint_file(path):
|
||||
|
||||
# R11 计数词漂移对照(锚表 CURRENT_COUNTS;轨迹措辞行豁免——变更记录节本身归 R4 禁设)
|
||||
in_code11 = False
|
||||
r11_active = "R11" not in ex
|
||||
for raw in text.splitlines():
|
||||
stripped = raw.strip()
|
||||
if stripped.startswith("```"):
|
||||
@@ -256,6 +268,8 @@ def lint_file(path):
|
||||
continue
|
||||
if in_code11 or stripped.startswith(";") or R11_TRACE_RE.search(raw):
|
||||
continue
|
||||
if not r11_active:
|
||||
continue
|
||||
# yaml/yml 的 # 行内注释是登记轨迹,不入正文扫描
|
||||
line = raw.split("#", 1)[0] if str(path).endswith((".yaml", ".yml")) else raw
|
||||
for pat, fix in CURRENT_COUNTS:
|
||||
@@ -296,6 +310,10 @@ def main():
|
||||
if p.name not in DEFAULT_EXCLUDE
|
||||
and not re.search(r"review|report|handoff", p.name, re.I)
|
||||
)
|
||||
targets += sorted(
|
||||
p for p in Path(ART_DIR).glob("*.md")
|
||||
if not re.search(r"review|report|handoff", p.name, re.I)
|
||||
)
|
||||
if not targets:
|
||||
print(f"未找到待检文件({DEFAULT_DIR}/)", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
Reference in new issue
Block a user