-
Notifications
You must be signed in to change notification settings - Fork 190
Open
bazel-contrib/rules-template
#160Description
As a common example, many rulesets do not declare all the deps
of their .bzl files.
Ever since Bazel 7 added the native https://bazel.build/reference/be/general#starlark_doc_extract rule, it makes sense for that to be the behavior of a bzl_library
target.
This is symmetric with proto_library
which produces a descriptor as an output.
There's a design smell where a macro has to do this:
https://github.com/bazelbuild/stardoc/blob/master/stardoc/stardoc.bzl#L112-L119
which means that alternative tools that want to read the docs don't know which target to refer to in order to gather that module-as-proto data.
Ideally what should happen:
- starlark_doc_extract in Bazel should have a java_binary that runs the tool outside of that native rule implementation (starlarkification)
- we can attach a validation action to bzl_library targets that executes that tool
- as a bonus, we can also add an OutputGroup to provide that proto data as output
Metadata
Metadata
Assignees
Labels
No labels