file-lower-snake-case
What it does
Section titled “What it does”Reports a file whose name (without .proto) is not lower_snake_case.
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”import public "google/protobuf/empty.proto";
message Old {...Configuration
Section titled “Configuration”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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| buf | FILE_LOWER_SNAKE_CASE |
full |