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

Move formatting of explanations into the report formatter #214

Merged
merged 1 commit into from
May 6, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented May 2, 2024

Move the explanation formatting from DefaultStringReporter to the ReportFormatter trait, so they can be overridden downstream (https://github.com/astral-sh/uv/blob/20e9589662396ca655e253c48afe7c60e05a6590/crates/uv-resolver/src/pubgrub/report.rs#L33). Upstreamed from astral-sh#19.

This resolves a large chunk of our diff with upstream (dev to uv main is 1278 lines, this PR to uv main is 743, measured as git diff <branch>..konsti/main-rebase-generic-reason | wc -l.

@konstin konstin added the enhancement New feature or request label May 2, 2024
@konstin konstin requested review from zanieb and Eh2406 May 2, 2024 11:28
Copy link
Member

@Eh2406 Eh2406 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, but I will leave final merge to @zanieb who has the deepest understanding of this code.

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think these makes a lot of sense as part of the formatter.

@Eh2406 Eh2406 added this pull request to the merge queue May 6, 2024
Merged via the queue into pubgrub-rs:dev with commit f3dbcda May 6, 2024
5 checks passed
@konstin konstin deleted the konsti/dev/add-report-explain branch May 6, 2024 17:54
@mpizenberg
Copy link
Member

Thanks for backporting that work from uv!

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

Successfully merging this pull request may close these issues.

4 participants