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

Machine-parseable error reporter #29

Closed
zkat opened this issue Aug 21, 2021 · 4 comments · Fixed by #90
Closed

Machine-parseable error reporter #29

zkat opened this issue Aug 21, 2021 · 4 comments · Fixed by #90
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@zkat
Copy link
Owner

zkat commented Aug 21, 2021

Might be nice to have a reporter that's able to output errors as JSON.

Ref: #28 (comment).

@zkat zkat added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 21, 2021
@dvermd
Copy link
Contributor

dvermd commented Oct 11, 2021

Hi, I've started working on a JSONReporter.

Were you thinking of pulling serde_json dependency or going to a hand crafted serialisation ?

@zkat
Copy link
Owner Author

zkat commented Oct 11, 2021

I think doing hand-serisalization is sufficient in this case, and it avoids an extra dependency. What do you think?

@dvermd
Copy link
Contributor

dvermd commented Oct 11, 2021

I think hand-written serialization will be good enough

@dvermd
Copy link
Contributor

dvermd commented Oct 11, 2021

I've got most of the serialization done. Only SourceCode is left.
Do you think SourceCode should made it to a machine-writable format ?

In case, yes:
Both NarratableReportHandler and GraphicalReportHandler use the same render_snippets function that calls render_context function which each reporter has its own.

A utility function can be extracted from render_snippets and be used in the 3 Reporters but I wonder where would be the best place to put this function.

I don't think the creation of the JSONReporter has its place in the MietteHandlerOpts builder. It can be instantiated directly or with its own builder to provide context_lines. What's your view on that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants