Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-zero exit code if checking failed when using --input #198

Open
stuebinm opened this issue Apr 15, 2024 · 2 comments
Open

non-zero exit code if checking failed when using --input #198

stuebinm opened this issue Apr 15, 2024 · 2 comments

Comments

@stuebinm
Copy link
Contributor

It would be nice if the validator returned a non-zero exit code when used on the cli with the --input option, either optionally behind a cli flag (e.g. --exit-code) or simply by default if --input is used. Perhaps it would even be possible to use different exit codes depending on severity of warnings or errors found (e.g. code 1 for fatal errors, 2 if there were no fatal errors but some warnings, etc.).

My motivation for this is that it'd make it much easier to use the tool in scripts or CI pipelines; currently the easiest way to answer "did validation fail?" i can find is to parse the json output with jq and check the validations (or issues_count) keys directly.

@antoine-de
Copy link
Member

yep, seems a good use case 👍

Maybe we can add flags like a --fail-on-errors/--fail-on-warnings? wouldn't it be easier for your CI use case?

@stuebinm
Copy link
Contributor Author

hm, that would of course also be an option — though it'd also make it harder to have a three-way split in e.g. a shell script (e.g. "do $x when everything's fine, $y if there were warnings, $z if there were errors).

but really i don't have a strong opinion either way, I can work with both :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants