0k / shyaml

YAML for command line
BSD 2-Clause "Simplified" License
767 stars 57 forks source link

Feature: Syntax checking/Validation subcommand #63

Open tomjn opened 3 years ago

tomjn commented 3 years ago

Sometimes it's enough to just know if a YAML file is a valid YAML file

It would be nice to have a subcommand that just loaded the YAML file/stdin and returned a good exit code, or a bad one with a syntax error.

We have a GH action that we'd like to validate a YAML file doesn't contain syntax errors ( a contributor made a mistake in a PR that made the document invalid and broke things ). We could try to retrieve a value from the file but to do this we need to assume certain things about the files contents.