scripts/check-schemas-load: black-formatted, and be verbose

This commit is contained in:
Athanasius 2022-03-12 15:05:10 +00:00
parent 7523d6dc17
commit c6e47813bb

View File

@ -10,16 +10,16 @@ script_path = pathlib.Path(sys.argv[0])
root_dir = script_path.parent.parent
# Take every file in the schemas directory
schemas_dir = root_dir / 'schemas'
schemas_dir = root_dir / "schemas"
failures = 0
for schema_file in schemas_dir.glob('*-v*.*.json'):
# print(f'Schema: {schema_file}')
with open(schema_file, 'r') as sf:
for schema_file in schemas_dir.glob("*-v*.*.json"):
print(f"Schema: {schema_file}")
with open(schema_file, "r") as sf:
try:
json = simplejson.load(sf)
except simplejson.JSONDecodeError as e:
print(f'Failed to load {schema_file}:\n{e!r}')
print(f"Failed to load {schema_file}:\n{e!r}")
failures += 1
if failures > 0: