Skip to content

oneof-lower-snake-case

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports a oneof name that is not lower_snake_case.

The Protobuf style guide writes oneof names as it does fields, in lower_snake_case, since the generators turn it into a property.

To fix, rename the oneof.

Reported
...
oneof BadChoice {
string b = 3;
...
}
...
protobuf:
lint:
rules:
oneof-lower-snake-case: warn # off (default), warn, error

Enabled by the presets: protobuf/buf-standard.

Suppress one line with sudsy-disable-next-line oneof-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 ONEOF_LOWER_SNAKE_CASE full