-
Notifications
You must be signed in to change notification settings - Fork 107
feat: output in json format option #317
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! Could you rebase to pickup #316?
src/Command/HealthCheckCommand.php
Outdated
$isFail = $results->defects(...$failureStatuses)->count() > 0; | ||
|
||
if ($isJsonOutput) { | ||
$output->write(\json_encode($results, \JSON_THROW_ON_ERROR, 512)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is meant to be read by some kind of automated script but would it hurt to add JSON_PRETTY_PRINT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes no difference in our case. I Added it
This adds a
--json
option to the health check command. It is a bit "hacky" so let me know if you want me to do this differently. This pull request also contains the fix from 316Thanks