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

exit codes and Docker #131

Open
KonradHoeffner opened this issue Mar 10, 2022 · 2 comments
Open

exit codes and Docker #131

KonradHoeffner opened this issue Mar 10, 2022 · 2 comments

Comments

@KonradHoeffner
Copy link
Contributor

KonradHoeffner commented Mar 10, 2022

I run pySHACL inside Docker and I cannot determine whether pySHACL aborted due to invalid parameters or whether it just found violations against the given SHACL shape, because in both cases the exit code is 1.
It is possible to create a workaround using grep and if-statements but that is inelegant and could break in the future.
Is there some official way to get pySHACL to exit with code 0 when there is no error in the given parameters or some other elegant way of determining if it succeeded running, regardless of whether the validation was successful or not?
The reason I need this is to implement a GitHub action on https://github.com/KonradHoeffner/shacl/ that should ultimately result in a GitHub repository badge with a count of validation errors.

@ashleysommer
Copy link
Collaborator

Thanks for the comment.

You raise a good point. I didn't consider that the python argparse library will exit with 1 when you pass in invalid arguments.
That does conflict with the shape violations return type.

Changing return values would unfortunately be a breaking change for some people, so this will need to wait until the next big release (probably v1.0), I'll make shape violation code 2, and shift the other return codes accordingly.

@KonradHoeffner
Copy link
Contributor Author

Thanks, that would be much appreciated!

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