Skip to content

fix(buffa-codegen): omit empty ancillary content files#107

Open
yordis wants to merge 2 commits intoanthropics:mainfrom
yordis:yordis/improve-codegen
Open

fix(buffa-codegen): omit empty ancillary content files#107
yordis wants to merge 2 commits intoanthropics:mainfrom
yordis:yordis/improve-codegen

Conversation

@yordis
Copy link
Copy Markdown

@yordis yordis commented May 8, 2026

  • Generator behavior now matches the contract documented on GeneratedFile — empty ancillary kinds are no longer emitted, and the package stitcher only include!s files that exist.
  • Eliminates placeholder files in generated trees (notably one-message-per-file schemas), which were pure noise in editors, search, code-intel graphs, and review diffs.
  • Regenerated checked-in WKT and bootstrap descriptor outputs reflect the new behavior; stale empty companion files are removed.

The crate doc already promised that empty ancillary kinds are not
emitted in default split mode, but the generator was writing
header-only `.__oneof.rs`, `.__view_oneof.rs`, and `.__ext.rs` files
for every input proto. In schemas with one message per file, the
generated tree triples in size with placeholder files that surface
in editors, search results, and review diffs while carrying no code.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@yordis
Copy link
Copy Markdown
Author

yordis commented May 8, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 8, 2026
Empty `pub mod view`/`oneof`/`ext` blocks (and the outer `__buffa`
wrapper when none would have items) were still emitted, leaving dead
namespace nodes in the generated tree.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
Copy link
Copy Markdown
Author

yordis commented May 8, 2026

Technically, I "fixed" two issues since I also clean up the mod blocks that don't have anything inside.

I can't find if such decision of leaving empty files around was intentional or not; so I decided to "fix" it. From the end-user perspective, I rather don't have such code around

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.

1 participant