Yamale icon indicating copy to clipboard operation
Yamale copied to clipboard

Fail when validation doesn't actually run

Open slimm609 opened this issue 2 years ago • 2 comments

When validating a file, if the schema or file doesn't actually exist, it still passes validation and returns an exit code of 0. If validation of an actual file fails then the exit code is 1. This is a similar behavior that would be expected for invalid files or missing files.

If the schema file doesn't exist or the number of matching yaml files is 0, then the exit code should probably be 1.

yamale -s not-a-schema not-a-file
Finding yaml files...
Found 0 yaml files.
Validating...
Validation success! 👍

slimm609 avatar Nov 24 '22 14:11 slimm609

Agreed, this should be fixed.

I can't give you a timeline right now for when we might get to this. We do accept pull requests if you'd like to submit a fix though :)

cblakkan avatar Nov 24 '22 19:11 cblakkan

Let me work on this. Assign it to me please

Andres-Ventura avatar Feb 19 '23 04:02 Andres-Ventura