-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
lint: emit json #21
Comments
When you say "other tools", do you mean tools that do not have a good way of parsing the |
Well, tools like frontends shouldn't have to parse that format (which currently exists of 3 components: the location, the message, and the ID of the check). It'd be much cleaner if they could receive the information in a structured format. |
Preliminary design of the JSON output is a stream of JSON objects of the following kind:
Where
@bradleyfalzon as the author of gopherci, do you have any feedback on the format? any fields that are missing? |
Real-world example (without the
|
Looks good to me, not sure if others would prefer to handle a single json document instead of a stream. What about errors, or is it just assumed that if you weren’t able to decode a plain text error is presented itself? |
It's much easier to be given a stream and treat it as a single document (read until EOF before processing) than it is to do streaming with a document.
For now, if the input is malformed, we'll continue emitting errors on stderr. In the future, these may become part of the JSON. |
Implemented in 479b882 |
We should provide a flag to output results in JSON. Such output would allow other tools to more easily consume our output.
The text was updated successfully, but these errors were encountered: