danielgtaylor / danielgtaylor/python-betterproto

Snake casing WORD regex mistakingly splitting lowercase mixed-digit field names

Open
#262 1 comment 0 reactions 0 assignees View on GitHub
compiler-bug
Dominant language
Python
Stars
1.8k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

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`.

Contributor guide

Open the contributing guide

Research direction

Use the provided Proto file and generated BadRegexTestMessage output as the reproduction case. Locate the WORD regex responsible for snake casing, run the generator with the ds18b20_serial_code field, and verify that the generated name remains ds18b20_serial_code rather than becoming ds18_b20_serial_code.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.