mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-20 08:43:55 +03:00
scripts/check-schemas-load: Standardise per-schema output
If we're going to say a schema is OK, then prefix any output with the schema file location.
This commit is contained in:
parent
c6e47813bb
commit
6b68a7c855
@ -13,14 +13,16 @@ root_dir = script_path.parent.parent
|
|||||||
schemas_dir = root_dir / "schemas"
|
schemas_dir = root_dir / "schemas"
|
||||||
failures = 0
|
failures = 0
|
||||||
for schema_file in schemas_dir.glob("*-v*.*.json"):
|
for schema_file in schemas_dir.glob("*-v*.*.json"):
|
||||||
print(f"Schema: {schema_file}")
|
|
||||||
with open(schema_file, "r") as sf:
|
with open(schema_file, "r") as sf:
|
||||||
try:
|
try:
|
||||||
json = simplejson.load(sf)
|
json = simplejson.load(sf)
|
||||||
|
|
||||||
except simplejson.JSONDecodeError as e:
|
except simplejson.JSONDecodeError as e:
|
||||||
print(f"Failed to load {schema_file}:\n{e!r}")
|
print(f"{schema_file}: Failed to load:\n{e!r}\n")
|
||||||
failures += 1
|
failures += 1
|
||||||
|
|
||||||
|
else:
|
||||||
|
print(f"{schema_file}: OK")
|
||||||
|
|
||||||
if failures > 0:
|
if failures > 0:
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user