From a3ff1d8d40d81296aeb236a0caec28a7982eb07b Mon Sep 17 00:00:00 2001 From: Hare Sudhan Date: Wed, 17 May 2023 15:38:27 -0400 Subject: [PATCH] validation fix (#2425) --- bin/validate/validate.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/validate/validate.py b/bin/validate/validate.py index 7389151d..cae209ac 100644 --- a/bin/validate/validate.py +++ b/bin/validate/validate.py @@ -74,7 +74,6 @@ class Validator: def validate_yaml_extension(self, file: DirEntry): """Validates the yaml extension""" - print(file.path) if fnmatch.fnmatch(file.path, "*.yml"): self.errors[file.path].append(InvalidFileName(file.path)) @@ -109,10 +108,12 @@ class Validator: print(f"\n\t{error}\n") elif isinstance(error, ValidationError): if (context := error.context) and len(context) > 0: - print(f"\n\t{context[0].message}\n") + print("\n\tIt failed because of one of the following reasons:") + messages = '\n\t\t'.join([c.message for c in context]) + print(f"\n\t\t{messages}") else: print(f"\n\t{error}\n") - print(f"The JSON Path is {error.json_path}") + print(f"\nThe JSON Path is {error.json_path}") else: print(f"\n\t{error}\n")