Skip to content

chore: format repo metadata#14262

Merged
JoeWang1127 merged 1 commit intogoogleapis:mainfrom
JoeWang1127:chore/format-repo-metadata
Mar 25, 2026
Merged

chore: format repo metadata#14262
JoeWang1127 merged 1 commit intogoogleapis:mainfrom
JoeWang1127:chore/format-repo-metadata

Conversation

@JoeWang1127
Copy link
Copy Markdown
Contributor

Format repo metadata, prepare for librarian Go migration.

The change is made through the following commands:

# sort keys and increase indent
find . -name ".repo-metadata.json" -exec sh -c 'jq -S --indent 4 "." "$1" > "$1.tmp" && mv "$1.tmp" "$1"' _ {} \;
# remove the newline at the end of file
find . -name ".repo-metadata.json" -exec perl -i -pe 'chomp if eof' {} +

@JoeWang1127 JoeWang1127 requested review from a team as code owners March 25, 2026 19:15
@JoeWang1127 JoeWang1127 enabled auto-merge (squash) March 25, 2026 19:18
Copy link
Copy Markdown
Contributor

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

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 standardizes the formatting of .repo-metadata.json files by removing trailing newlines. However, the reviewer noted that removing trailing newlines can cause compatibility issues with POSIX standards and common command-line tools. It is suggested to revert this change unless it is a strict requirement for an upcoming librarian Go migration.

"language": "go",
"library_type": "GAPIC_AUTO",
"release_level": "stable"
} No newline at end of file
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.

medium

While the formatting is now consistent across the repository, removing the final newline from files is generally not recommended. It deviates from POSIX standards for text files and can cause issues with common command-line tools like cat, wc, and git.

Unless the upcoming 'librarian Go migration' strictly requires files without a trailing newline, I'd suggest removing the perl -i -pe 'chomp if eof' {} + step from your script to maintain better compatibility with standard text file conventions.

@JoeWang1127 JoeWang1127 merged commit 54f46f7 into googleapis:main Mar 25, 2026
12 checks passed
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