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

change doctests to use `cabal-doctest` #49

Closed cdepillabout closed 5 years ago

cdepillabout commented 5 years ago

Recent versions of stack (anything after stack-2.1), have changed so that doctests no longer work.

I believe that doctests need to be using the cabal-doctest package in order to work correctly when compiling with stack.

pretty-simple's doctests need to be switched over to use cabal-doctest.

This should also make CI stop failing when building with stack.

chshersh commented 5 years ago

That's highly unfortunate that simple doctest doesn't work. I believe that this has something to do with .ghc.environment files. They are crucial for doctest to work, but it was a long debate to stop generating these files.

Unfortunately, cabal-doctest is not always a drop-in replacement for plain doctest because usage of cabal-doctest requires to use custom-setup stanza and with this stanza, you can't have internal libraries (last time I checked).

cdepillabout commented 5 years ago

with custom-setup, you can't have internal libraries (last time I checked).

Oh, I didn't realize this.

I guess this should be okay for now, since pretty-simple doesn't have any internal libraries, but I can imagine just using cabal-doctest isn't a good solution for everyone.