Skip to content

Commit

Permalink
Show all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Apr 24, 2024
1 parent 93578ed commit 606ac53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def validate_entries(_):
from marda_registry.utils import load_registry_collection

counts = {}
errors = []
for type_ in (FileType, Extractor):
entries = load_registry_collection(
type_,
Expand All @@ -56,10 +57,13 @@ def validate_entries(_):
for extractor in entries:
for filetype in extractor.supported_filetypes:
if filetype.id not in filetype_ids:
raise RuntimeError(
errors.append(
f"Extractor {extractor.name=} has invalid filetype {filetype.id=}. Should be one of {filetype_ids=}"
)

if errors:
raise RuntimeError("\n".join(errors))

print("Done!")


Expand Down

0 comments on commit 606ac53

Please sign in to comment.