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

Return error exit code for "No lines…" error. #74

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tomalec
Copy link
Contributor

@tomalec tomalec commented Jul 8, 2022

Fixes #72

This is one way to address the above issue.
If "no lines" is considered an error, which makes it impossible to produce a meaningful result, we should return an error code.
That way this error is catchable by external users.

@exussum12
Copy link
Owner

This makes a lot of sense thanks! There are 2 failing tests, any chance you could update the tests too ?

@tomalec
Copy link
Contributor Author

tomalec commented Jul 8, 2022

I updated the testNoCoveredLines, but I don't know why testWorkingCorrectly was asserting No lines found in the first place 😕

@exussum12
Copy link
Owner

Sorry for the build spam, I will check out locally and get this merged ASAP. Sorry about delay, I have been travelling

@exussum12
Copy link
Owner

looking at this, it causes some issues when adding here. I think I have another fix, which is more of an oversight. If the parsing of the json fails (due to not being JSON for example) an exception is thrown, but not with a status code. The default status is 0 and the code then exits with 0, which the shell interprets as success.

I will test some more scenarios with this and get a PR up

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

Successfully merging this pull request may close these issues.

diffFilter outputs in incorrect format if there are no changes
2 participants