0.3.1-0-pre.2.fix.2
This commit is contained in:
@@ -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()}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user