mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-28 20:38:52 -06:00
fix: check every romfolders source_ref
model.romfolders.source_refs walks every ref a setup carries, offers[] and searched_by[] included, which the three hand lists in validate_schemas and the tests skipped: 4176 refs were never matched against the declared sources. validate_schemas parses them with split_refs and reports a malformed part.
This commit is contained in:
1 parent
ed19ae4198
commit
3467b80b38
4 files changed
+29
-26
No files matched your search
@@ -879,6 +879,8 @@ def _romfolder_errors() -> list[str]:
|
||||
"""Every scraped setup against its schema, and every source_ref against
|
||||
the sources the file declares: a ref naming no declared repository can
|
||||
never be read back at a pin."""
|
||||
from model.romfolders import source_refs, split_refs
|
||||
|
||||
directory = REPO_ROOT / PLATFORMS_DIR / "romfolders"
|
||||
if not directory.is_dir():
|
||||
return []
|
||||
@@ -893,16 +895,15 @@ def _romfolder_errors() -> list[str]:
|
||||
if errors:
|
||||
continue
|
||||
declared = set(data["sources"])
|
||||
refs = [data["roms_root"]["source_ref"]]
|
||||
refs += [data["case_ref"]] if data.get("case_ref") else []
|
||||
refs += [r["source_ref"] for key in ("skip", "hidden", "media") for r in data.get(key, [])]
|
||||
for row in data["folders"]:
|
||||
refs.append(row["source_ref"])
|
||||
refs += [b["source_ref"] for b in (row.get("board_defaults") or {}).values()]
|
||||
for ref in refs:
|
||||
for part in ref.split("; "):
|
||||
key = part.split(" ", 1)[0]
|
||||
for ref in source_refs(data):
|
||||
try:
|
||||
parts = split_refs(ref)
|
||||
except ValueError as exc:
|
||||
out.append(f"{label}: {exc}")
|
||||
continue
|
||||
for key, path, lines in parts:
|
||||
if key not in declared:
|
||||
part = f"{key} {path}" + (f":{lines}" if lines else "")
|
||||
out.append(f"{label}: source_ref {part!r} names undeclared source {key!r}")
|
||||
return out
|
||||
|
||||
|
||||
Reference in new issue
Block a user