Skip to content

file-lower-snake-case

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports a file whose name (without .proto) is not lower_snake_case.

The Protobuf style guide names files in lower_snake_case, and generated file names and import paths derive from it. A different style gives different names in each language.

To fix, rename the file and update the imports.

Reported
import public "google/protobuf/empty.proto";
message Old {
...
protobuf:
lint:
rules:
file-lower-snake-case:
level: warn # off (default), warn, error
options:
pattern: "^[a-z0-9]+(?:_[a-z0-9]+)*$"
Option Type Default Description
pattern string "^[a-z0-9]+(?:_[a-z0-9]+)*$" Regular expression the file name without its extension must match; empty: not checked.

Enabled by the presets: protobuf/buf-standard.

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