Skip to content

Commit 006dac2

Browse files
committed
Relocate version comprobation
1 parent 31d6d98 commit 006dac2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

relecov_tools/build_schema.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def __init__(
5959
self.output_folder = out_dir
6060

6161
# Get version option
62+
if not self.version:
63+
raise ValueError("The next_version variable is not set.")
6264
self.version = version
6365

6466
# Validate show diff option
@@ -358,7 +360,6 @@ def build_new_schema(self, json_data, schema_draft):
358360
f"[INFO] Feature {db_feature_key} is not present in database ({self.excel_file_path})"
359361
)
360362
continue
361-
362363
if (
363364
"required" in db_feature_key
364365
or "required" == schema_feature_key
@@ -482,9 +483,6 @@ def save_new_schema(self, json_data):
482483
bool: True if the schema was successfully saved, False otherwise.
483484
"""
484485
try:
485-
if not self.version:
486-
raise ValueError("The next_version variable is not set.")
487-
488486
path_to_save = f"{self.output_folder}/relecov_schema.json"
489487
with open(path_to_save, "w") as schema_file:
490488
json.dump(json_data, schema_file, ensure_ascii=False, indent=4)

0 commit comments

Comments
 (0)