Closed danwos closed 5 years ago
I'm not sure if rule invocation can be documented, as this information is nothing from the rule itself but from other BUILD files or based on bazel internal calculation.
So has far as I have understood:
For Attribute list I think an Attribute must get its own place in the bazel domain.
So .. bazel:attribute:: //main:target:rule:attribute
Reason, the documentation of an Attribute can be complex and contain rst-content as well. So putting it inside the head of a rule description may destroy the layout if e.g the docs is longer than x chars or even contains an image.
For the attribute I agree it makes sense to create bazel:attribute
.
In case of the invocation I disagree that it is hard to get once you already have the attributes of the rule. Example:
my_rule = rule(
implementation = _my_rule_impl,
attrs = {
"srcs" : attr.string(
default="foo",
doc = "Source files.",
),
"deps" : attr.string(
default="bar",
doc = "Dependencies of this target.",
),
}
)
The invocation is:
my_rule(srcs, deps)
Ahh got it. You do not need the calls of the current rule by other rules/bzl-files, but just the "call-printing" containing name and attributes. Okay, this is easily possible.
Rule documentation suppose to have: