cdepillabout / pretty-simple

pretty-printer for Haskell data types that have a Show instance
https://hackage.haskell.org/package/pretty-simple
BSD 3-Clause "New" or "Revised" License
243 stars 29 forks source link

Move away from build-type Custom #129

Closed andreabedini closed 4 months ago

andreabedini commented 1 year ago

cabal-doctest is no longer unsupported or needed.

The author of the doctest package recommends^1 to run doctests with

cabal repl --with-ghc=doctest

This change removes the custom-setup and adjusts the test-suite to use the recommended approach above. The package doctest is added to the project with extra-packages to make sure its dependencies are always in scope (a small variation to the approach suggested by the doctest author).

andreabedini commented 1 year ago

Could you change this so that the doctests will be run when you do cabal test?

Unfortunately the short answer is no. This is exactly how doctest recommends to be run https://github.com/sol/doctest#running-doctest-for-a-cabal-package.

cabal has a new feature that would allow running doctest with cabal test but that would require coordination with doctest I am afraid. So I thought I'd stick with the recommended way.

cdepillabout commented 1 year ago

@andreabedini My two requirements here would be:

cabal-doctest currently meets these requirements, but has the following drawbacks:

It would be great if there was a doctest solution that meets all of my above requirements, and doesn't have any of these drawbacks.

andreabedini commented 4 months ago

The new SetupHooks API will provide a better solution.