fix: drop PyYAML dep so verify job pytest passes
CI & Release / Verify documentation (push) Skipped
CI & Release / Verify simulator (push) Skipped
CI & Release / Trivy scan (push) Skipped
CI & Release / Semantic Release (push) Skipped
CI & Release / Verify documentation (pull_request) Successful in 4s
CI & Release / Verify simulator (pull_request) Successful in 11s
CI & Release / Trivy scan (pull_request) Successful in 8s
CI & Release / Semantic Release (pull_request) Skipped

Store doc rules in bin/docs_rules.json (stdlib json). test_check_docs no
longer fails in the simulator job that only installs simulator/requirements.txt.
This commit is contained in:
2026-07-10 11:02:55 +01:00
parent df04736336
commit 826cef0c3e
7 changed files with 61 additions and 72 deletions
+3 -10
View File
@@ -4,17 +4,13 @@
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
try:
import yaml
except ImportError: # pragma: no cover - stdlib fallback for minimal envs
yaml = None # type: ignore[assignment]
ROOT = Path(__file__).resolve().parents[1]
RULES_PATH = Path(__file__).with_name("docs_rules.yaml")
RULES_PATH = Path(__file__).with_name("docs_rules.json")
LINK_RE = re.compile(r"!?\[[^\]]*\]\(([^)]+)\)")
BARE_SEE_RE = re.compile(r"(?<![\[(/])see\s+(\d{2})(?![\w-])", re.IGNORECASE)
@@ -22,10 +18,7 @@ SKIP_SCHEMES = ("http://", "https://", "mailto:", "tel:", "#")
def load_rules(path: Path = RULES_PATH) -> dict:
text = path.read_text(encoding="utf-8")
if yaml is not None:
return yaml.safe_load(text)
raise RuntimeError("PyYAML is required to load docs_rules.yaml")
return json.loads(path.read_text(encoding="utf-8"))
def slug_heading(text: str) -> str:
+42
View File
@@ -0,0 +1,42 @@
{
"markdown_paths": [
"docs/**/*.md",
"README.md",
"CONTRIBUTING.md",
"AGENTS.md",
"simulator/README.md",
"prototype/README.md",
"infra/**/README.md"
],
"glossary": {
"file": "docs/00-glossary.md"
},
"banned_link_targets": [
"03-storage-design.md"
],
"glossary_section_anchors": [
"data--storage",
"swarm--robotics",
"infrastructure--delivery"
],
"preferred_term_anchors": [
"t0--hot",
"t1--warm",
"t2--shared",
"t3--warehouse",
"t4--dev",
"source-of-truth",
"architecture-layer-1--ingestion",
"architecture-layer-2--storage-and-transform",
"architecture-layer-3--serving-and-sync",
"pipeline-stage",
"bulk-sync",
"offload",
"rclone",
"adr",
"asr"
],
"readability": {
"forbid_bare_see_refs": true
}
}
-47
View File
@@ -1,47 +0,0 @@
# Documentation rules enforced by CI (bin/check_docs.py).
# See docs/improvement/ci-rules.md for rationale and PR workflow.
markdown_paths:
- docs/**/*.md
- README.md
- CONTRIBUTING.md
- AGENTS.md
- simulator/README.md
- prototype/README.md
- infra/**/README.md
glossary:
file: docs/00-glossary.md
# Relative link targets that must never reappear (known regressions).
banned_link_targets:
- 03-storage-design.md
# Glossary links to these section headers are allowed but reported as warnings
# when a term-specific ### anchor exists (see preferred_term_anchors).
glossary_section_anchors:
- data--storage
- swarm--robotics
- infrastructure--delivery
# First-use vocabulary should link to these ### anchors, not section headers.
preferred_term_anchors:
- t0--hot
- t1--warm
- t2--shared
- t3--warehouse
- t4--dev
- source-of-truth
- architecture-layer-1--ingestion
- architecture-layer-2--storage-and-transform
- architecture-layer-3--serving-and-sync
- pipeline-stage
- bulk-sync
- offload
- rclone
- adr
- asr
readability:
# Fail when prose uses bare "see 05" instead of a markdown link.
forbid_bare_see_refs: true