-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add support to dart analyze
for a JSON based output
#45068
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
Comments
Below is one proposal for the structure of the JSON to be produced. It's expressed as pseudo-Dart code, where an abstract class denotes a JSON map and typedefs introduce semantic names for primitive types. Comments and alternate designs are welcome, this is merely a starting point for discussion. I will note that this object can't currently be produced from the content of either the legacy protocol nor the content of LSP. In order to support producing this format in
|
This format SGTM |
From this:
It looks like the initial json structure we parse will be an object, and that will contain a list of You might instead consider having the outer structure just be a json list of Alternatively, having the outer wrapper would allow us to more easily include more information in the future (instead of just producing diagnostics, we could produce timing information and diagnostics for example). |
My two cents on the versioning question: I think it's better to have a top level object with a version number. It's a very small investment (overhead is a small constant), but the potential benefit is huge, because we don't know how this data structure may need to evolve in the future, and it's quite conceivable that some future improvement would be quite difficult to do in a backward-compatible way. |
@bwilkerson any update on this? |
Not that I'm aware of. I think the next step is to assign someone to actually implement it. @devoncarew |
Brian, I'd assumed that you were driving this. If not then we might want to rethink how we're addressing #44905. If we put this in the critical path of testing the why not promoted work, we'd either have to:
Without somebody driving both the json format changes and the test.py changes we're highly unlikely to get this done by the next stable release. #44905 can also be satisfied by slightly extending the existing machine format. We might want to do that and decouple the json format with the why not promoted work. |
Sorry. If you explicitly stated that then I missed it. I assumed that either you or Paul would be driving the work. I just offered to help by creating an initial proposal of what the protocol might look like. I can certainly do more if you want me to.
I might be wrong, but I don't think that's true. I think we'd still need to update |
To avoid further confusion, I suggest we use the "assignee" field for this bug to track who is working on it. I'm assigning to Brian for now because my current understanding is that he's the one who has the best combination of time, knowledge, and interest to be successful at it. Brian/Devon, feel free to change that if you decide it's a better fit for someone else. |
FYI we no longer rely on serialized analyzer output in google3--"analyzer as a library" makes it unnecessary--so I will not be following this work ;) thanks. |
Status update. The analysis server now sends back all of the information required in order to produce this format. The The |
Addressed in e4bb500. |
Support for the |
There are at least two uses cases that would benefit from
dart analyze
having a more extensible and more complete machine readable output format. I believe that JSON would be a good format for this purpose. The proposal is to support a new output format named "json" (as indart analyze --format=json
).The text was updated successfully, but these errors were encountered: