Skip to content

field-lower-snake-case

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports a field name that is not lower_snake_case.

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.

Reported
...
}
...
string BadName = 1;
map<string, string> BadMap = 2;
...
string b = 3;
string C = 4;
}
}
...
protobuf:
lint:
rules:
field-lower-snake-case: warn # off (default), warn, error

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

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
buf FIELD_LOWER_SNAKE_CASE full