Skip to content

enum-value-upper-snake-case

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports an enum value name that is not UPPER_SNAKE_CASE.

The Protobuf style guide writes enum values in UPPER_SNAKE_CASE, as the generated code of many languages writes constants.

To fix, rename the value.

Reported
...
...
BAD_ENUM_UNSPECIFIED = 0;
Bad_Value = 1;
}
...
protobuf:
lint:
rules:
enum-value-upper-snake-case: warn # off (default), warn, error

Enabled by the presets: protobuf/buf-standard.

Suppress one line with sudsy-disable-next-line enum-value-upper-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 ENUM_VALUE_UPPER_SNAKE_CASE full