fix(generator): escape multi-line braces and backtick unknown doc tags in yard formatting - #1337
Draft
suztomo wants to merge 2 commits into
Draft
fix(generator): escape multi-line braces and backtick unknown doc tags in yard formatting#1337suztomo wants to merge 2 commits into
suztomo wants to merge 2 commits into
Conversation
Member
Author
suztomo
marked this pull request as draft
August 31, 2026 21:38
Member
Author
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).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.Solution
{outside backticks:`...`) and replace all unescaped{outside backticks (including when followed by backtick code spans) 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, 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#36487, where:toys ci --yard --gems google-cloud-compute-v1passed with 0 warnings and 0 errors.Related issues: