fix(generator): escape multi-line braces and backtick unknown doc tags in yard formatting - #1337
Open
suztomo wants to merge 8 commits into
Open
fix(generator): escape multi-line braces and backtick unknown doc tags in yard formatting#1337suztomo wants to merge 8 commits into
suztomo wants to merge 8 commits into
Conversation
Member
Author
suztomo
marked this pull request as draft
August 31, 2026 21:38
Member
Author
suztomo
marked this pull request as ready for review
September 1, 2026 19:13
Member
Author
|
Checking this
googleapis/google/ads/googleads/v21.
googleapis/googleapis@d94a97e on August 7th deleted the Bazel package. |
Member
Author
|
#1339 is a fix for failing "gapic-generator-ruby-bazel-presubmit (gapic-images)" check. |
Member
Author
Member
Author
|
As seen in the preview of google-cloud-ruby https://github.com/googleapis/google-cloud-ruby/pull/36512/changes, this pull request fixes the preexisting issue of adding unnecessary
The proto file is at https://github.com/googleapis/googleapis/blob/02fc2b28bc702c8bb45735631ea0ad66893067fb/google/chat/v1/reaction.proto#L206 |
aandreassa
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





Summary
This PR addresses YARD documentation warnings and errors generated when formatting proto docstrings containing multiline braces (such as inline JSON examples or range syntax) and proto comments with unknown doc tags (such as
@patternor@required).Example rendering problem is at googleapis/librarian#7461 (comment).
Problem
Gapic::FormattingUtils.escape_line_bracespreviously matched{and}on the same line using@brace_detector.[{name: "app1", port: 8080}, {name:\n"app1"...}) or multiline ranges ({min: min-value, max:\nmax-value}or{100, 200,\n300}), the opening{on the first line remained unescaped.{min: ...}across lines as an object/class link, resulting inCannot resolve link to min: from text:warnings.@pattern(e.g., in regex patterns) or@required compute.instancegroups.addInstancescause YARD to emit[warn]: Unknown tag @<tag>because YARD interprets any@wordat the start of a line or after whitespace as a doc tag....or ~~~ ... ~~~) and multiline inline code spans (`...`) that may contain braces (e.g."divider": {}or multiline resource URI templates) or mentions (e.g.@FooBot).Solution
in_fence) and Multiline Inline Code Spans (in_code_span):in_fencestate across lines when encountering lines starting with ``` or ~~~.in_code_spanstate across lines when an inline code span starts on one line and ends on another.\escapes.{outside backticks:`...`) and replace all unescaped{outside backticks with\{.}is on the same line or subsequent lines.(?<=\A|\s)@tagoutside backtick spans that is not a known YARD tag (@param,@return,@see,@!attribute,@attr,@attr_reader,@attr_writer, etc.), wrap it in backticks (`@tag`) so YARD renders it as literal text rather than an unrecognized tag directive.support@example.com) and string literals in code blocks/quotes remain unaffected.Preview in
google-cloud-rubyA full regeneration preview across
google-cloud-rubywas verified in draft PR googleapis/google-cloud-ruby#36512, where:google/apps/card/v1/card.rbandgoogle/chat/v1/annotation.rb) and multiline inline backtick spans (e.g. ingoogle/cloud/aiplatform/v1/featurestore_online_service.rb) are preserved verbatim without spurious escapes.toys ci --yard --gems google-apps-chat-v1,toys ci --yard --gems google-cloud-compute-v1, andtoys ci --yard --gems google-cloud-ai_platform-v1passed with 0 warnings and 0 errors.Related issues: