Skip to content

pretty-print package listings in errors - #8989

Open
mgsium wants to merge 3 commits into
haskell:masterfrom
mgsium:render-tabular
Open

mgsium wants to merge 3 commits into
haskell:masterfrom
mgsium:render-tabular

Conversation

@mgsium

@mgsium mgsium commented May 31, 2023 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

mgsium commented Jun 1, 2023

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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