23andMe / Yamale

A schema and validator for YAML.
MIT License
666 stars 88 forks source link

Fail when validation doesn't actually run #206

Open slimm609 opened 1 year ago

slimm609 commented 1 year ago

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! 👍
cblakkan commented 1 year ago

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 :)

Andres-Ventura commented 1 year ago

Let me work on this. Assign it to me please