Menu

#23 Exit code of failed validations should be non-zero

v1.0_(example)
open
nobody
None
5
2016-01-15
2016-01-15
No

If the command line tool fails to validate a yaml file, then — in good Unix tradition — the exit code should be non-zero. So the kwalify tool could be easily be used in shell scripts and makefiles. Currently the exit code is always zero.

This is what I currently observe:

$ kwalify -f schema.yaml failing_data_file.yaml ; echo $?                          
_etc/hosts-kwalify.yaml#0: INVALID
...
0

Note that the equivalent perl utility (pkwalify in the CPAN module Kwalify.pm) does it right.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB