field-lower-snake-case
What it does
Section titled “What it does”Reports a field name that is not lower_snake_case.
Why it matters
Section titled “Why it matters”The Protobuf style guide writes fields in lower_snake_case. Generators convert the name to camel case or leave it as it is, and the JSON mapping is derived from it, so a field that is written in another form maps to an unexpected name.
To fix, rename the field.
Example
Section titled “Example”...}
... string BadName = 1; map<string, string> BadMap = 2;... string b = 3; string C = 4; }}
...Configuration
Section titled “Configuration”protobuf: lint: rules: field-lower-snake-case: warn # off (default), warn, errorEnabled by the presets: protobuf/buf-standard.
Suppress one line with sudsy-disable-next-line field-lower-snake-case in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| buf | FIELD_LOWER_SNAKE_CASE |
full |