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

pretty-print package listings in errors #8989

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mgsium
Copy link
Collaborator

@mgsium mgsium commented May 31, 2023

Extends #8234 to fix #8189 by replacing uses of renderCommaListAnd with renderListPretty for the list-bin and run commands
(e.g. for list-bin : see #8189 (comment))


Please include the following checklist in your PR:

@mgsium mgsium marked this pull request as ready for review May 31, 2023 22:21
@ulysses4ever
Copy link
Collaborator

Thanks for taking this on! Could you add a description of how the observed behavior changed, maybe with an example? Ideally, it'd be an integration test (see https://github.com/haskell/cabal/tree/master/cabal-testsuite). But at least commit message and PR message could show it.

Also, it touches more than list-bin, right? This should be mentioned in the descriptions as well!

Thanks again!

@mgsium mgsium changed the title Use renderListPretty for list-bin problems pretty-print package listings in errors Jun 1, 2023
@mgsium
Copy link
Collaborator Author

mgsium commented Jun 1, 2023

Absolutely. I'll have a look at writing an integration test, and I'll write a more accurate commit message when I squash. For the description, how can I recreate the list-bin case you mentioned in #8189?

Also, I see a few other uses of renderListCommaAnd, specifically for TargetProblemNoneEnabled and CannotPruneDependencies error messages. Should I also replace these?

(Apologies for the delay on this, I have exams this time of year)

@ulysses4ever
Copy link
Collaborator

Hey @mgsium! Sorry it took so long to get back to you! It'd be great to nail this. To your questions...

how can I recreate the list-bin case you mentioned in #8189?

It's a bit hacky: I did cabal init -nm --lib --tests and then manually duplicated the test stanza in the cabal file and gave it another name.

Also, I see a few other uses of renderListCommaAnd, specifically for TargetProblemNoneEnabled and CannotPruneDependencies error messages. Should I also replace these?

I thin it'd be fine, yes. It'd be even better if you added some integration tests to show how this changes cabal's behaviors, but I understand that creating tests is a bit boring, so, please, do your best and remember that some improvement is better than none.

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

Successfully merging this pull request may close these issues.

cabal is a poet
2 participants