-
Notifications
You must be signed in to change notification settings - Fork 231
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
BXL: format ctx.output.print_json()
arguments
#759
Comments
You mean I am not very sure what do you mean here. You mean you want the feature that the output of Right now the output of
|
Yes I do, my bad.
Yes, I made a POC at main...cbarrete:buck2:print-json. I'm sure it wouldn't be merged as is because it just makes a lot of private APIs public for convenience, but the point is that it renders e.g. I think that this behavior makes sense for most use cases? If someone is to output data as JSON, surely it is for something else to consume it, and the debug representation of starlark objects is unusable for those. A concrete example is compilation database generation in C++: without this feature, one needs to write the JSON out to a file, print its path and have the user copy that file, as opposed to "just" redirecting stdout to the desired location. |
Yeah, it makes sense. I will look into this. Thank you for reporting. |
Objects like
cmd_args
orRunInfo
are formatted when dumped withctx.output.write_json()
. Is there a way to do the same thing withctx.output.print_json()
? If not, would this be accepted as a new feature, via an optional argument that defaults toFalse
?The text was updated successfully, but these errors were encountered: