0.3.1-0-pre.2.fix.2

This commit is contained in:
2026-09-20 21:49:23 +02:00
parent bded27c944
commit 1835464bb3
13 changed files with 168 additions and 357 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# file: scripts/audit_project_workspace_rules.py
# version: 6
# version: 7
"""Audit mechanically verifiable games.sasedev workspace boundaries."""
@@ -15,6 +15,13 @@ import tomllib
SEMVER = re.compile(r"^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-(?:0-pre|1-alpha|2-beta|3-rc)\.[1-9][0-9]*(?:\.fix\.[1-9][0-9]*)?)?$", re.ASCII)
def is_generated_path(path: pathlib.Path, root: pathlib.Path) -> bool:
"""Return whether a path belongs to an ignored generated tree."""
relative = path.relative_to(root)
return "gen" in relative.parts
def main() -> int:
"""Run project-specific workspace audits."""
@@ -86,10 +93,14 @@ def main() -> int:
errors.append(
f"DOC-011: documentary directory entry point must use 000-README.md: {readme_path.relative_to(root).as_posix()}"
)
forbidden_assets = [path for path in (root / "crates").rglob("assets") if path.is_dir()]
forbidden_assets = [
path for path in (root / "crates").rglob("assets") if path.is_dir() and not is_generated_path(path, root)
]
for path in forbidden_assets:
errors.append(f"GAME-ASSET-001: assets directory forbidden inside crates: {path.relative_to(root).as_posix()}")
for java_path in sorted(root.rglob("*.java")):
if is_generated_path(java_path, root):
continue
if not java_path.is_relative_to(root / "Android"):
errors.append(f"GAME-ANDROID-001: Java source outside Android/: {java_path.relative_to(root).as_posix()}")