Skip to content

Enable doctesting through cabal-docspec#361

Merged
andreabedini merged 1 commit intomasterfrom
andrea/cabal-docspec
Jan 19, 2022
Merged

Enable doctesting through cabal-docspec#361
andreabedini merged 1 commit intomasterfrom
andrea/cabal-docspec

Conversation

@andreabedini
Copy link
Copy Markdown
Contributor

@andreabedini andreabedini commented Jan 19, 2022

This PR enables doctests using cabal-docspec

cabal-docspec has some advantages:

  1. It doesn't need to be mentioned in linear-base.cabal
  2. The same binary works with multiple versions of GHC

This PR:

  1. Adds cabal-docspec to the nix-shell. Note I have done this in a
    terrible way, downloading the precompiled binary from github. I would
    appreciate any help.
  2. Adds a step to the CI workflow that runs the tests.
  3. There's also a small tweag to the doctests, since (AFAU) cabal-docspec
    is a bit more picky about what it puts in scope.

This PR superseeds #317.

name = "cabal-docspec";

src = pkgs.fetchurl {
url = "https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20211114/cabal-docspec-0.0.0.20211114.xz";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, considering the constraints, this may be the best solution available to us, since it seems to be working well enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think so. In the end, we are not redistributing nor depending on cabal-docspec. It's an utility anyone can use to run the doctests. Perhaps I could include some instructions about getting and using cabal-docspec, from a developer point of view.

@aspiwack
Copy link
Copy Markdown
Member

I think this will need no further modification for the time being. Please merge if you're ok with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants