Skip to content

Commit 2b9a1c6

Browse files
Googlercopybara-github
Googler
authored andcommitted
Update symbolic macro stardoc protos for visibility, finalizers, and attribute inheritance
Symbolic macros have a mandatory visibility attribute - we need to document it. To support attribute inheritance in documentation generation, it suffices to extract non-Starlark-defined attributes in macros, and expose the fact that they are non-Starlark-defined - so that a documentation renderer can provide a link to bazel.build common attributes for the natively defined common attributes that don't have a doc string. Take the opportunity to refactor addDocumentableAttributes() into a better shape (taking an explicit argument for the implicitly-added attributes), and fix the long-standing bug that Stardoc has been inserting a non-existent "name" attribute for aspects (which was partly obscured by the old addDocumentableAttributes() implementation). RELNOTES: Fix starlark_doc_extract proto output for symbolic macro visibility, attribute inheritance, and rule finalizers; and remove non-existent "name" attribute from starlark_doc_extract output for aspects. PiperOrigin-RevId: 700811908
1 parent 8778ce0 commit 2b9a1c6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

third_party/bazel/src/main/protobuf/stardoc_output.proto

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ message MacroInfo {
126126
// The module where and the name under which the macro was originally
127127
// declared.
128128
OriginKey origin_key = 4;
129+
130+
// True if this macro is a rule finalizer.
131+
bool finalizer = 5;
129132
}
130133

131134
// Representation of a Starlark rule, repository rule, or module extension tag
@@ -161,6 +164,9 @@ message AttributeInfo {
161164

162165
// If true, the attribute is non-configurable.
163166
bool nonconfigurable = 7;
167+
168+
// If true, the attribute is defined in Bazel's native code, not in Starlark.
169+
bool natively_defined = 8;
164170
}
165171

166172
// Representation of a set of providers.

0 commit comments

Comments
 (0)