Linter rulesProtobuf linter rules
Protobuf linter rules
Rulesets
Rules
| Rule | What it checks | Since |
|---|---|---|
directory-same-package | This rule checks whether all the .proto files of a directory declare the same package. | 0.9.0 |
enum-comment-defined | This rule checks whether every enum of a Protobuf file has a leading comment. | 0.9.0 |
enum-naming | This rule checks whether the name of every enum of a Protobuf file is in PascalCase. | 0.9.0 |
enum-no-allow-alias | This rule checks whether any enum sets the allow_alias option. | 0.9.0 |
enum-value-comment-defined | This rule checks whether every enum value of a Protobuf file has a leading comment. | 0.9.0 |
enum-value-naming | This rule checks whether the name of every enum value of a Protobuf file is in UPPER_SNAKE_CASE. | 0.9.0 |
enum-value-prefix | This rule checks whether the names of the values of every enum start with the name of the enum in UPPER_SNAKE_CASE, for example PET_KIND_DOG in the enum PetKind. | 0.9.0 |
enum-zero-value-suffix | This rule checks whether the zero value of every enum ends with a suffix, _UNSPECIFIED by default. | 0.9.0 |
field-comment-defined | This rule checks whether every field of a Protobuf file has a leading comment. | 0.9.0 |
field-naming | This rule checks whether the name of every field of a Protobuf file is in lower_snake_case. | 0.9.0 |
file-naming | This rule checks whether the name of every Protobuf file is in lower_snake_case, with the .proto extension. | 0.9.0 |
import-no-cycle | This rule checks whether Protobuf files import each other in a cycle. | 0.9.0 |
import-no-public | This rule checks whether a Protobuf file uses import public. | 0.9.0 |
import-no-weak | This rule checks whether a Protobuf file uses import weak. | 0.9.0 |
import-resolved | This rule checks whether every file imported by a Protobuf file can be found. | 0.9.0 |
import-used | This rule checks whether every file imported by a Protobuf file is actually used. | 0.9.0 |
imports-sorted | This rule checks whether the import statements of a Protobuf file are sorted by path. | 0.9.0 |
message-comment-defined | This rule checks whether every message of a Protobuf file has a leading comment. | 0.9.0 |
message-naming | This rule checks whether the name of every message of a Protobuf file is in PascalCase. | 0.9.0 |
oneof-comment-defined | This rule checks whether every oneof of a Protobuf file has a leading comment. | 0.9.0 |
oneof-naming | This rule checks whether the name of every oneof of a Protobuf file is in lower_snake_case. | 0.9.0 |
package-defined | This rule checks whether every Protobuf file declares a package. | 0.9.0 |
package-directory-match | This rule checks whether every Protobuf file is in the directory that corresponds to its package, for example acme/pets/v1 for the package acme.pets.v1. | 0.9.0 |
package-naming | This rule checks whether the package name of a Protobuf file consists of lower_snake_case components separated by dots. | 0.9.0 |
package-no-import-cycle | This rule checks whether packages import each other in a cycle. | 0.9.0 |
package-options-consistent | This rule checks whether the files of a package set the same language-specific file options, such as go_package and java_package. | 0.9.0 |
package-same-directory | This rule checks whether all the files of a package are in the same directory. | 0.9.0 |
package-version-suffix | This rule checks whether the last component of the package name of a Protobuf file is a version, such as v1 or v1beta2. | 0.9.0 |
rpc-comment-defined | This rule checks whether every RPC of a Protobuf file has a leading comment. | 0.9.0 |
rpc-naming | This rule checks whether the name of every RPC of a Protobuf file is in PascalCase. | 0.9.0 |
rpc-no-client-streaming | This rule checks whether any RPC uses client streaming. | 0.9.0 |
rpc-no-server-streaming | This rule checks whether any RPC uses server streaming. | 0.9.0 |
rpc-request-response-unique | This rule checks whether every message is used as the request or the response of a single RPC. | 0.9.0 |
rpc-request-standard-name | This rule checks whether the request type of every RPC is named after the RPC, for example GetPetRequest for the RPC GetPet. | 0.9.0 |
rpc-response-standard-name | This rule checks whether the response type of every RPC is named after the RPC, for example GetPetResponse for the RPC GetPet. | 0.9.0 |
service-comment-defined | This rule checks whether every service of a Protobuf file has a leading comment. | 0.9.0 |
service-naming | This rule checks whether the name of every service of a Protobuf file is in PascalCase. | 0.9.0 |
service-suffix | This rule checks whether the name of every service ends with a suffix, Service by default. | 0.9.0 |
spell-check | This rule checks the spelling of the comments of a Protobuf file. | 0.9.0 |