Skip to content

fix: no underscores after numbers when converting to snake case#662

Open
YodaEmbedding wants to merge 1 commit intodanielgtaylor:masterfrom
YodaEmbedding:fix/no_underscores_after_numbers
Open

fix: no underscores after numbers when converting to snake case#662
YodaEmbedding wants to merge 1 commit intodanielgtaylor:masterfrom
YodaEmbedding:fix/no_underscores_after_numbers

Conversation

@YodaEmbedding
Copy link

@YodaEmbedding YodaEmbedding commented Mar 16, 2025

Summary

Fixes #657

Usage:

>>> betterproto.casing.snake_case("C2S2C c2s2c")
'c2s2c_c2s2c'

>>> betterproto.casing.snake_case("Client2Server CLIENT2SERVER client2Server")
'client2server_client2server_client2server'

>>> betterproto.casing.snake_case("clientToServer")
'client_to_server'

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
    • This change has an associated test.
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@YodaEmbedding YodaEmbedding force-pushed the fix/no_underscores_after_numbers branch from dad2bf3 to 67892b2 Compare March 16, 2025 21:38
@YodaEmbedding YodaEmbedding force-pushed the fix/no_underscores_after_numbers branch from 67892b2 to 369dbe3 Compare March 16, 2025 21:41
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.

In generated field name, an undescore is introduced after a number

1 participant