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

Add an option for srb tc to output in json format #1293

Closed
hdoan741 opened this issue Jul 16, 2019 · 1 comment
Closed

Add an option for srb tc to output in json format #1293

hdoan741 opened this issue Jul 16, 2019 · 1 comment
Labels
enhancement New feature or surprising current feature

Comments

@hdoan741
Copy link
Contributor

Problem

I want to analyze the result of srb tc with some tool. I'd like to have a format that's more programmatically friendly.

Proposed solution

Add an option for srb tc to output in json format

> srb tc --format=json
@hdoan741 hdoan741 added enhancement New feature or surprising current feature unconfirmed This issue has not yet been confirmed by the Sorbet team labels Jul 16, 2019
@jez jez removed the unconfirmed This issue has not yet been confirmed by the Sorbet team label Aug 23, 2019
@jez
Copy link
Collaborator

jez commented Aug 23, 2019

We've been pretty hesitant to add this feature in the past (it was one of the first features I tried to implement when I joined the team and I was taught that this is not as great as it sounds).

Adding something to serialize errors to JSON requires committing to some sort of API stability, which is hard. We're already forced to do this to some extent with the LSP editor integration: each language client operates with the guarantee that the LSP spec is more or less stable. So we'd prefer to just have LSP, and not have to re-implement something that approximates LSP to get this feature.

And what's more, the things that people usually want a JSON output format for are actually just things that an LSP editor plugin would do anyways. So at that point, why not just use LSP?

We've instrumented many codemods at Stripe on top of Sorbet using no more than the existing flags—in particular, the first line of the error message is pretty reasonable to parse with bash.

If you can come back with specific things that the existing console output isn't good enough to support right now, I'm happy to track those in separate issues, but the generic feature request of "--format=json" seems like it's a solution in search of a problem to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature
Projects
None yet
Development

No branches or pull requests

2 participants