-
Notifications
You must be signed in to change notification settings - Fork 4
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 report formatter concept for customization of report output #10
Conversation
fd30571
to
83b547f
Compare
I pass the |
TLDR. I love it! I had been working toward something like this in https://github.com/pubgrub-rs/pubgrub/tree/reporter_trait, if there are any of those changes that look like good ideas please take them. But your re-factor seems much more user focused and a better place to start. I would eventually like our reporting infrastructure to support directly outputting to |
Good to hear! Here's an upstream pull request pubgrub-rs#158
Ah interesting. I agree it seems a bit more complicated than we need to get started. I think there are some ideas there we can build on though.
Agreed! |
Closing in favor of pubgrub-rs#158 |
Uses astral-sh/pubgrub#10 to drastically simplify our reporter implementation. This will allow us to make use of upstream improvements to the reporter e.g. astral-sh/pubgrub#8 without multiple duplicative pull requests.
Adds a
ReportFormatter
trait and aReporter::report_with_formatter
method allowing customization of formatting the report without reimplementing reporter internals. Currently, we useformat_external
andformat_terms
but we can refine formatting in the future as needed e.g. all theexplain
methods in the reporter.Adds a
DefaultStringReportFormatter
which implements the existing format for theDefaultStringReporter
.You can see how much easier this is to use in the example diff at fd30571