Skip to content

Commit

Permalink
fix: display all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierlou committed Mar 26, 2024
1 parent 449d3a0 commit cb18162
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/assert_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def check(obj, version, parents=''):
else:
raise Exception('No required file found')

message = ''
for schema_path in to_check:
with open(schema_path, 'r') as f:
schema = json.load(f)
Expand All @@ -60,10 +61,13 @@ def check(obj, version, parents=''):

errors = check(schema, version)
if errors:
message = (
if message:
message += '\n\n'
message += (
f"Versions are mismatched within the schema '{schema['name']}', "
f"expected version '{version}' but:"
)
for e in errors:
message += f"\n- {e[0]} has version '{e[1]}'"
raise Exception(message)
if message:
raise Exception(message)

0 comments on commit cb18162

Please sign in to comment.