-
Notifications
You must be signed in to change notification settings - Fork 710
Add --haddock-output-dir flag to cabal haddock. #8788
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 --haddock-output-dir flag to cabal haddock. #8788
Conversation
How do I link this PR to the issue? |
Edit your OP and add “closes #xyzx” where |
We certainly need a test. |
Could you please give me some advice and direction for writing a test (where to add the test, how the feature should be tested)? This is my first time using Haskell outside uni or hobby projects. I tried looking at the test suite but found it very confusing. |
First, it's readme at https://github.com/haskell/cabal/tree/master/cabal-testsuite (don't read past FAQ though). Second, try to find somewhat similar test in https://github.com/haskell/cabal/tree/master/cabal-testsuite/PackageTests, copy-paste and edit it... I'd probably look into tests under |
cd7d1e6
to
b84ec57
Compare
@LiisiKerik do you need more directions w.r.t. tests other than what I wrote here #8788 (comment)? I hope we can bring this over the line soon. |
@ulysses4ever Thank you, those references to other test files were very useful. I wrote a couple of tests (which at first seemed to behave reasonably) but then noticed the existence of |
62cd4d4
to
5b5c8fb
Compare
@ulysses4ever @Kleidukos @coot I added a couple of tests and the bug mentioned above is fixed. I'm not sure I picked the best place to make the --haddock-odir path absolute - it would be nice if there was a better place or way to do it. |
@ulysses4ever Personally I'm inclined to merge it and do some manual QA on it. |
9ab0ece
to
ea5fe9d
Compare
@coot @Mikolaj Is there something else I should fix in order to make it ok to merge? @Kleidukos If I understood the comment correctly then you thought it was ok to merge? If you have already looked at my code and decided that it's ok then could you please mark this PR as reviewed? |
@LiisiKerik: thank you very much the tests. This is a big PR, so we just need to throw a lot pairs of eyes at it. What is your design for backward compatibility here? Are there any corner cases in which people's workflows (e.g, in CI or scripts) stop working after this PR? Unexpected results for workflows that keep working? |
@Mikolaj What are the possible backward compatibility issues? I probably don't understand the big picture very well since it's my first pull request in cabal.
What would be a good way to find out? I'm only aware that the automatic checks in the server all pass but what other things could I do to find the possible issues? |
Pardon me, if I'm asking silly questions. You know your code. Did you change any defaults for the other flags, for example? Is the behaviour of cabal with the default setting of the new flag (when the user does not specify it) the same as it was before this PR? Another angle would be a few manual tests. Move your Then test the other way around to see how new cabal works with old Perhaps try the newest haddock and then a version from a year ago. Your PR is substantial (and from what I can quickly see, it non-trivially changes and improves the codebase), hence the extra burden. I apologise that our CI does not do such tests automatically, but tests that mix versions of tools are especially tricky to automate and then to triage when they fail. Edit: countless typos |
cce91cd
to
48afeaf
Compare
@coot @ulysses4ever Is there something else I should fix in order to make it ok to merge? |
One more thing: why the Show instances? Are they really needed for anything? Bear in mind that |
Just for the record: I applaud the manual QA effort but I’d be frustrated if we’re gonna use it as an excuse for not adding tests. I’m very glad that the PR author added some. |
Those were an accidental leftover from testing. I removed those now. |
7291b92
to
7ab43bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
One last comment: the changelog file supports Markdown markup. I'd add backticks to commands like cabal haddock
and the flag name. That way our release notes will look real slick.
Does the synopsis field also support markdown? Or only the description? |
@LiisiKerik both. We should document it of course... |
3bc5c31
to
21963f4
Compare
Since I'm new to the process, I don't know what to do next now that the changes have been marked as approved. Do I (or someone else?) need to change tags on the pull request? Do merges happen continuously or only before releases? |
Add a |
There's just one commit, so the merge-me label should suffice. |
@ffaf1 @ulysses4ever Thank you. But, it seems that I don't have the right to add labels. I don't see the gear icon next to labels. |
I'll do it, thank you for your patience @LiisiKerik :) |
Sorry for another question... but what is the mergify dashboard and how do I log in there? |
@mergify rebase |
This flag gives the user full control over the directory where the documentation is placed.
✅ Branch has been successfully rebased |
21963f4
to
42cd942
Compare
@LiisiKerik sorry, it's just a confusing error message: i don't believe you can do anything about it. Let's see if my command helps. |
And it's done! @LiisiKerik thanks a lot for the great contribution and patience along the way! |
This flag gives the user full control over the directory where the documentation is placed. Closes #8270
Tested manually. Documentation for the new flag is displayed with --help. Behavior without the new flag seems the same. The new flag works both in cabal.project and from the command line and behaves as expected. No new unit tests added.