Files
Pier_v1/Code/교각모델링/check_doc_refs.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환
- Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용
- pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관)
- worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md)
- D:\Rhino-MCP 경로 참조를 새 위치로 치환

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:20:18 +09:00

24 lines
1.1 KiB
Python

"""Check that every backtick path / script name referenced in a DOC markdown file exists, and the version
token matches the change history. usage: python check_doc_refs.py <DOC-relative path>"""
import re
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
doc = ROOT / "DOC" / sys.argv[1]
s = doc.read_text(encoding="utf-8")
code = ROOT / "Code" / "교각모델링"
missing = []
for ref in sorted(set(re.findall(r"`([^`]+)`", s))):
if ref.endswith(".py"):
if not (code / ref).exists():
missing.append(ref)
elif "/" in ref and not any(ch in ref for ch in "*<>~") and re.search(r"\.(md|3dm|json)$|/$", ref):
if not (ROOT / ref).exists():
missing.append(ref)
scripts = sorted({r for r in re.findall(r"`([a-z_]+\.py)`", s)})
ver = re.search(r"_v(\d+\.\d+\.\d+)\.md$", doc.name).group(1)
hist = [l for l in s.splitlines() if l.startswith("| v")][-1].split("|")[1].strip()
print("scripts referenced", len(scripts), "missing refs", missing, "version", ver, "history", hist,
"OK" if hist == "v" + ver else "MISMATCH")