Skip to content

feat(internal/librarian/java): add whitespace formatting helpers for README rendering - #6592

Closed
yangyzs wants to merge 3 commits into
googleapis:mainfrom
yangyzs:feat/java-readme-whitespace
Closed

feat(internal/librarian/java): add whitespace formatting helpers for README rendering#6592
yangyzs wants to merge 3 commits into
googleapis:mainfrom
yangyzs:feat/java-readme-whitespace

Conversation

@yangyzs

@yangyzs yangyzs commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Add minLeadingSpaces and trimLeadingWhitespace helper functions to calculate and normalize code snippet indentation for README block rendering. Add unit tests in readme_test.go.

For #6515

…README

Add minLeadingSpaces and trimLeadingWhitespace helper functions to calculate
and normalize code snippet indentation for README block rendering. Add unit
tests in readme_test.go.

For googleapis#6515
@yangyzs
yangyzs requested a review from a team as a code owner June 30, 2026 17:21

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds two helper functions, minLeadingSpaces and trimLeadingWhitespace, along with their corresponding unit tests, to compute and trim the minimum leading indentation from a slice of lines. The review feedback correctly identifies that the conditional check len(line) >= minSpaces in trimLeadingWhitespace is redundant since non-empty lines are guaranteed to have at least minSpaces characters, and suggests simplifying the code by removing the unreachable else branch.

Comment thread internal/librarian/java/readme.go Outdated
Signed-off-by: yangyzs <171981480+yangyzs@users.noreply.github.com>
@yangyzs
yangyzs removed request for a team and zhumin8 July 5, 2026 23:18
@yangyzs
yangyzs marked this pull request as draft July 5, 2026 23:18
@sofisl sofisl closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants