-
Couldn't load subscription status.
- Fork 191
Description
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