Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Fix renumbering bugs - #194

Open
bduffany wants to merge 1 commit into
zxh0:masterfrom
bduffany:renumbering-fix
Open

Fix renumbering bugs#194
bduffany wants to merge 1 commit into
zxh0:masterfrom
bduffany:renumbering-fix

Conversation

@bduffany

@bduffany bduffany commented Mar 22, 2026

Copy link
Copy Markdown

Fix three renumbering bugs:

  • Avoid rewriting field or enum names that contain digits when renumbering values
  • Replace full hexadecimal enum literals instead of corrupting partial matches
  • Ignore braces inside comments and strings when locating renumbering blocks

Add regression tests for each case, which demonstrate the bugs being fixed.

Also, introduces a test helper applyEdits to make some of the tests clearer (it allows asserting on the actual before/after of the replacement, making the assertion more obvious)

Fixes #190

@bduffany
bduffany marked this pull request as ready for review March 22, 2026 19:36
@bduffany
bduffany force-pushed the renumbering-fix branch 5 times, most recently from efbbb0c to 0540f2d Compare March 22, 2026 19:53
Fix three renumbering bugs in proto3RenumberLogic:
- avoid rewriting field or enum names that contain digits when renumbering values
- replace full hexadecimal enum literals instead of corrupting partial matches
- ignore braces inside comments and strings when locating renumbering blocks

Add focused regression tests for each case.

Signed-off-by: Brandon Duffany <brandon@buildbuddy.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: regenerating numbers rename the enumeration constants

1 participant