Is there a way to enable generation of documentation for all packages globally? Something equivalent to documentation: True in ~/.cabal/config? I didn't find anything in the documentation.
Right now if you want docs for everything, you have to remember to add --haddock every time you perform an operation that might build new packages, or rebuild them later when docs are needed.
There is some overlap here with #846. At least with adding haddocks. There is also a "global" stack.yaml file which ends up being sourced if a stack.yaml doesn't exist in either the current directory or its ancestors.
Also, I believe, though @snoyberg can correct me if I'm wrong, is that as soon as you have a project stack.yaml it takes total precedence over the global stack.yaml and the latter is not even sourced or mappended to the project one. The monoid instance is instead used to apply command line arguments to override the stack.yaml
The config is initialized by mappending a default empty ConfigMonoid and one created by reading the stack.yaml. We could then drop the global config in between the empty monoid so the list in https://github.com/commercialhaskell/stack/blob/c0053b601a5f6f5870bd402bb29c39af38c18ab7/src/Stack/Config.hs#L217 would also contain a global config.
This is probably a bad idea in a lot of cases because you are suddenly depending on a users global config, bye-bye reproducible builds. So I wonder if it's possible to mark some options like --haddock as "safe" and only allow those to be applied. I've just wanted this myself a few times.
Never mind my monoid suggestions. after reading #876 I found out that ~/.stack/global/stack.yaml is not the being sourced (instead it's ~/.stack/stack.yaml) and that was what lead me to believe that global options were not being combined correctly.
Yeah, you're right. #846 would solve this too. Closing in favor of #846.
For future searchers, this is implemented now! 馃帀
build:
haddock: true
Most helpful comment
For future searchers, this is implemented now! 馃帀