0.1.0-2-beta.1.fix.2
This commit is contained in:
@@ -11,6 +11,11 @@ import pathlib
|
||||
import sys
|
||||
|
||||
|
||||
FORBIDDEN_PATHS = (
|
||||
"builds",
|
||||
)
|
||||
|
||||
|
||||
REQUIRED_PATHS = (
|
||||
"crates/apps/game-reflex-poc-desktop/Cargo.toml",
|
||||
"crates/apps/game-snake-poc-desktop/Cargo.toml",
|
||||
@@ -42,15 +47,24 @@ def main() -> int:
|
||||
arguments = parser.parse_args()
|
||||
root = pathlib.Path(arguments.root).resolve()
|
||||
missing: list[str] = []
|
||||
forbidden_present: list[str] = []
|
||||
for relative in REQUIRED_PATHS:
|
||||
if not (root / relative).exists():
|
||||
missing.append(relative)
|
||||
for relative in FORBIDDEN_PATHS:
|
||||
if (root / relative).exists():
|
||||
forbidden_present.append(relative)
|
||||
if missing:
|
||||
for relative in missing:
|
||||
print(f"DIST-LAYOUT-001: missing required path: {relative}", file=sys.stderr)
|
||||
print(f"Distribution layout audit: {len(missing)} violation(s)", file=sys.stderr)
|
||||
return 1
|
||||
print(f"Distribution layout audit: clean ({len(REQUIRED_PATHS)} required path(s))")
|
||||
if forbidden_present:
|
||||
for relative in forbidden_present:
|
||||
print(f"DIST-LAYOUT-002: generated path must stay outside repository: {relative}", file=sys.stderr)
|
||||
print(f"Distribution layout audit: {len(forbidden_present)} violation(s)", file=sys.stderr)
|
||||
return 1
|
||||
print(f"Distribution layout audit: clean ({len(REQUIRED_PATHS)} required path(s), {len(FORBIDDEN_PATHS)} forbidden path(s) absent)")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user