Description
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
coverageChecker/src/functions.php
Lines 94 to 95 in 495c9cb
logs an error, does not produce any output, and returns "successfully".
IMHO, it should either
- log a successful JSON response - if there are no lines, there are no phpCS errors as well. Consider no lines a valid input, #73
- return error code - if it's unable to produce a meaningful, compliant result, if it got invalid arguments, it should fail in an observable manner. Return error exit code for "No lines…" error. #74
Metadata
Metadata
Assignees
Labels
No labels