From cb181623f4c25981b3c676cb1f516fa9f22a1248 Mon Sep 17 00:00:00 2001 From: Pierlou Date: Tue, 26 Mar 2024 16:34:30 +0100 Subject: [PATCH] fix: display all errors --- .github/workflows/assert_version.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assert_version.py b/.github/workflows/assert_version.py index 7b9de1d..117c360 100755 --- a/.github/workflows/assert_version.py +++ b/.github/workflows/assert_version.py @@ -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) @@ -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)