-
Notifications
You must be signed in to change notification settings - Fork 79
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
Haddock flags precedence and local override #572
Conversation
haskell/haddock.bzl
Outdated
@@ -85,6 +83,10 @@ def _haskell_doc_aspect_impl(target, ctx): | |||
ghc_args.add([x.path for x in set.to_list(target[HaskellLibraryInfo].source_files)]) | |||
ghc_args.add(["-v0"]) | |||
|
|||
# haddock flags should take precedence over ghc args, hence are in | |||
# last position | |||
ghc_args.add(hs.toolchain.haddock_flags) |
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.
FYI, using args.add
in order to append a list has been deprecated. This will result in an error in a future Bazel release. We should use ghc_args.add_all()
instead.
See https://docs.bazel.build/versions/master/skylark/backward-compatibility.html#new-args-api
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. Fixed.
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.
LGTM after switching to add_all
.
f057a10
to
d42266e
Compare
@Profpatsch if you can redo a review, I pushed a new commit which also add custom haddock flag per rule. |
The latter change I object to. We have separate documentation targets. Those alone should encapsulate all documentation concerns from the moment they exist. |
@mboes what do you suggest? Use case, we use |
If haskell_doc(
name = ":some_haskell_lib_doc",
deps = [":some_haskell_lib"],
haddock_flags = ["-Wwarn"],
)
haskell_doc(
deps = [":another_lib", ":yet_another_lib", ":some_haskell_lib_doc"],
) |
Should I revert this change in the hope that someone will later introduces the change you propose in |
There are two commits in this PR. The first is fine and the second is controversial. Therefore, merge the first one, drop the second one and create a ticket for a composable |
d42266e
to
6f3abfc
Compare
I just opened #583, could you please complete it with your design ideas and technical solutions. |
Okay, let’s discuss the change there and we can merge this . |
The rational behinds is that
haddocks_flags
can be used to overridecompiler_flags
. For example, ifcompiler_flags
uses-Werror
, we may want to disable it using-Wwarn
inhaddock_flags
to allows non-fatal warnings.Future haddock version will support
-Werror
in haddock.