Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Unreleased changes template.
as UTF-8 on all platforms.
* (coverage) Coverage with `--bootstrap_impl=script` is fixed
([#2572](https://github.com/bazelbuild/rules_python/issues/2572)).
* (sphinxdocs) Do not crash when `tag_class` does not have a populated `doc` value.
Fixes ([#2579](https://github.com/bazelbuild/rules_python/issues/2579)).

{#v0-0-0-added}
### Added
Expand Down
2 changes: 1 addition & 1 deletion sphinxdocs/private/proto_to_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _render_module_extension(self, mod_ext: stardoc_output_pb2.ModuleExtensionIn
# Ensure a newline between the directive and the doc fields,
# otherwise they get parsed as directive options instead.
if not doc_string and tag.attribute:
self.write("\n")
self._write("\n")
self._render_attributes(tag.attribute)
self._write(":::::\n")
self._write("::::::\n")
Expand Down
11 changes: 11 additions & 0 deletions sphinxdocs/tests/proto_to_markdown/proto_to_markdown_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
default_value: "[BZLMOD_EXT_TAG_A_ATTRIBUTE_1_DEFAULT_VALUE]"
}
}
tag_class: {
tag_name: "bzlmod_ext_tag_no_doc"
attribute: {
name: "bzlmod_ext_tag_a_attribute_2",
type: STRING_LIST
default_value: "[BZLMOD_EXT_TAG_A_ATTRIBUTE_2_DEFAULT_VALUE]"
}
}
}
repository_rule_info: {
rule_name: "repository_rule",
Expand Down Expand Up @@ -151,6 +159,9 @@ def test_basic_rendering_everything(self):
self.assertRegex(actual, "bzlmod_ext_tag_a_attribute_1")
self.assertRegex(actual, "BZLMOD_EXT_TAG_A_ATTRIBUTE_1_DOC_STRING")
self.assertRegex(actual, "BZLMOD_EXT_TAG_A_ATTRIBUTE_1_DEFAULT_VALUE")
self.assertRegex(actual, "{bzl:tag-class} bzlmod_ext_tag_no_doc")
self.assertRegex(actual, "bzlmod_ext_tag_a_attribute_2")
self.assertRegex(actual, "BZLMOD_EXT_TAG_A_ATTRIBUTE_2_DEFAULT_VALUE")

self.assertRegex(actual, "{bzl:repo-rule} repository_rule")
self.assertRegex(actual, "REPOSITORY_RULE_DOC_STRING")
Expand Down