-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial docspec setup. #124
Conversation
This adds the setup required to run doc-testing using cabal-docspec, developed by Oleg Grenrus (@phadej). This is the same setup that the the "kmettverse" uses (e.g. the comonad package). It also starts converting existing documentation to docspecs, i.e. the Control.Monad.Except module.
I went ahead and converted the remaming examples to docspec format. A couple of observations:
|
@andreabedini I'm very happy that someone has undertaken this: it looks great! However, we need to ensure that this passes CI, and it currently fails on macOS. I also suspect it'll fail on Windows. |
@kozross thanks. I have been too liberal in copying comonad’s setup without realising how specific that environment is. I’ll get this to work on Monday! |
@andreabedini If you want something that's more general, you can follow my |
oh, I like your setup! I wish cabal-docspec was on Hackage (or had binaries for macOS and Windows). |
I like your setup, but after thinking a bit about it, I belive we should only run docspec on the platforms we have a binary release for, which AFAIK is only Linux. The reason is not adding complexity to the mtl CI. I would not want |
I'm really torn about this. On the one hand, you are absolutely right, but on the other hand, I feel this is basically relegating other platforms to second-class status in the CI, which I oppose. |
<3 I am 1000% with you on this! Perhaps we should direct our efforts to support Oleg? Also, docspec on linux vs no docspec anywhere is still a step forward! |
Gargantuan effort thank you! 😄 |
If cabal-docspec breaks, i'll pick it up i suppose. |
Let's just use @kozross's fork and get homogeneous coverage
This doesn't make sense to me. What about having a binary privileges it to be doctested, when the doctests are part of the test contract for every distribution on every platform? Koz already has a fork that covers mac and windows. We should be committing to doctests as a supplement to the unit and property tests we already do, not as coverage for any binary, and further, we don't cut binaries, we cut archives with source. |
That's ok. I guess my real intent was to delimit as much as possible what's on mtl's team plate and what is not. Using a fork of cabal-extras works fine and it allows us to cover all platforms, which is great, but also brings in more work on @kozross :-) Reading back what I wrote I think by "having a binary release for" I meant to say "someone else is responsible for". I am happy with whatever way you decide to go. Doc-testing is the goal here, not the details of how we install the tool. Do you want me to update this PR following @kozross |
@andreabedini That would be ideal, yes. |
nevermind, they CI fails. I will have a look. |
right, cabal-docspec fails to compile on ghc 9.4.1, which is the kind of issues I was expecting in my previous comment. I guess I can just disable doc testing on ghc 9.4.1? |
At this point doc testing should be done with cabal's new code generators feature e.g. https://github.com/gbaz/cabal-doctest-demo |
This adds the setup required to run doc-testing using cabal-docspec, developed by @phadej.
This is the same setup that the the "kmettverse" uses (e.g. the comonad package).
It also starts converting existing documentation to docspecs, i.e. the Control.Monad.Except module.