mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 21:43:23 -05:00
fix: require the jsonschema format checkers
This commit is contained in:
1 parent
892cff38bc
commit
e9653069a2
7 files changed
+59
-5
No files matched your search
@@ -804,7 +804,9 @@ def _check_fbneo(cache_dir: str, offline: bool) -> Finding:
|
||||
|
||||
# --- CI toolchain -----------------------------------------------------------
|
||||
|
||||
_PIN_RE = re.compile(r'"?([A-Za-z0-9_.\-]+)((?:[<>=!~]=?[^,"\s]+)(?:,[<>=!~]=?[^,"\s]+)*)?"?')
|
||||
_PIN_RE = re.compile(
|
||||
r'"?([A-Za-z0-9_.\-]+)(?:\[[^\]]*\])?((?:[<>=!~]=?[^,"\s]+)(?:,[<>=!~]=?[^,"\s]+)*)?"?'
|
||||
)
|
||||
_USES_RE = re.compile(r"uses:\s*([\w.\-]+/[\w.\-]+)@([0-9a-f]{40})\s*(?:#\s*(\S+))?")
|
||||
|
||||
|
||||
|
||||
@@ -254,6 +254,20 @@ def _semantic_install_checks(path: Path, manifest: dict) -> list[str]:
|
||||
return out
|
||||
|
||||
|
||||
def unchecked_formats() -> list[str]:
|
||||
"""Formats the schemas declare that this jsonschema install cannot check.
|
||||
|
||||
date-time and uri need the format extras; without them the ten format
|
||||
constraints of the published schemas were accepted unread.
|
||||
"""
|
||||
used = {
|
||||
match
|
||||
for path in SCHEMAS.glob("*.json")
|
||||
for match in re.findall(r'"format"\s*:\s*"([^"]+)"', path.read_text(encoding="utf-8"))
|
||||
}
|
||||
return sorted(used - set(FormatChecker().checkers))
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument(
|
||||
@@ -263,6 +277,16 @@ def main() -> int:
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
unchecked = unchecked_formats()
|
||||
if unchecked:
|
||||
# jsonschema skips a format it has no checker for, silently.
|
||||
print(
|
||||
f"ERROR no checker for format(s) {', '.join(unchecked)}: "
|
||||
'install "jsonschema[format-nongpl]"',
|
||||
file=sys.stderr,
|
||||
)
|
||||
return 1
|
||||
|
||||
errors: list[str] = []
|
||||
errors.extend(
|
||||
_validate_yaml_directory(ROOT / "emulators", "emulator.schema.json")
|
||||
|
||||
Reference in new issue
Block a user