cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Add PackageCheck pretty print

Open ffaf1 opened this issue 3 years ago • 10 comments

Both principled (we export, use a pretty printer) and pragmatic (we don't surprise programs depending on Cabal by modifying Show behaviour (yet)) stance.


Please include the following checklist in your PR:

Testsuite runs fine.

ffaf1 avatar Jul 22 '22 14:07 ffaf1

Since it makes visible changes to the output, would it make sense to add a test capturing the chosen output format just in case?

ulysses4ever avatar Aug 08 '22 12:08 ulysses4ever

This patch should not change the program (cabal-install) output, if it does it is a bug! Or am I misreading you?

ffaf1 avatar Aug 08 '22 13:08 ffaf1

Since cabal-install uses Cabal as a library, I thought it’s possible to provoke these new error messages through cabal-install. But I haven’t thought too hard about it so I may be wrong.

ulysses4ever avatar Aug 09 '22 00:08 ulysses4ever

Just to clarify what the patch does, there are no new error messages. We are simply replacing occourrences of show with pretty-print functions.

In the future we might want to deprecate or modify show to make it work correctly (i.e. output a representation of the data which could be read back and not an user-oriented error message); but that should be make with due care, since third party tools might rely on this incorrect behaviour.

Il 08 agosto 2022 alle 17:16 Artem Pelenitsyn ha scritto:

Since cabal-install uses Cabal as a library, I thought it’s possible to provoke these new error messages through cabal-install. But I haven’t thought too hard about it so I may be wrong.

-- Reply to this email directly or view it on GitHub: https://github.com/haskell/cabal/pull/8311#issuecomment-1208750201 You are receiving this because you authored the thread.

Message ID: @.***>

ffaf1 avatar Aug 09 '22 06:08 ffaf1

@mergify refresh

Mikolaj avatar Aug 12 '22 14:08 Mikolaj

refresh

✅ Pull request refreshed

mergify[bot] avatar Aug 12 '22 14:08 mergify[bot]

@mergify refresh

Mikolaj avatar Aug 12 '22 14:08 Mikolaj

refresh

✅ Pull request refreshed

mergify[bot] avatar Aug 12 '22 14:08 mergify[bot]

@mergify rebase

Mikolaj avatar Aug 12 '22 14:08 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Aug 12 '22 15:08 mergify[bot]

Let me rebase to include a workaround to our CI instability and fix the tests.

Mikolaj avatar Aug 16 '22 22:08 Mikolaj

@mergify rebase

Mikolaj avatar Aug 16 '22 22:08 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Aug 16 '22 22:08 mergify[bot]