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

diffFilter outputs in incorrect format if there are no changes #72

Open
tomalec opened this issue Jul 8, 2022 · 0 comments · Fixed by #73 · May be fixed by #74
Open

diffFilter outputs in incorrect format if there are no changes #72

tomalec opened this issue Jul 8, 2022 · 0 comments · Fixed by #73 · May be fixed by #74

Comments

@tomalec
Copy link
Contributor

tomalec commented Jul 8, 2022

When I call diffFilter on an empty change set, it logs a "No lines found!" error but returns a 0 success code.

For example:

diffFilter --phpcsStrict < (git diff HEAD...HEAD)  phpcs.json --report=phpcs 0

outputs an empty string, instead of a JSON object.

In my scripting, when a command returns success code, I assume it produced the output in expected format as it does for any successful input and run.
If the command encounters an error, making it unable to proceed to produce meaningful output, it should return error code, so I could catch that and act accordingly.

But, the line

error_log('No lines found!');
return;

logs an error, does not produce any output, and returns "successfully".
IMHO, it should either

@tomalec tomalec changed the title diffFilter outputs in incorrect format if there are not changes diffFilter outputs in incorrect format if there are no changes Jul 8, 2022
tomalec added a commit to tomalec/coverageChecker that referenced this issue Jul 8, 2022
and output a valid result.

Fixes exussum12#72
tomalec added a commit to tomalec/coverageChecker that referenced this issue Jul 8, 2022
@tomalec tomalec linked a pull request Jul 8, 2022 that will close this issue
exussum12 pushed a commit that referenced this issue Aug 29, 2022
and output a valid result.

Fixes #72
@exussum12 exussum12 reopened this Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants