python-betterproto
python-betterproto copied to clipboard
Snake casing WORD regex mistakingly splitting lowercase mixed-digit field names
Proto file:
message BadRegexTestMessage {
uint64 ds18b20_serial_code = 1;
}
Result:
class BadRegexTestMessage(betterproto.Message):
ds18_b20_serial_code: int = betterproto.uint64_field(1)
ds18b20
becomes ds18_b20
.
A proposed fix would be changing WORD = "[A-Z]*[a-z]*[0-9]*"
for WORD = "[A-Z]*[a-z0-9]*"
.