Linter rulesProtobuf linter rules

Protobuf linter rules

Rulesets

Rules

RuleWhat it checksSince
directory-same-packageThis rule checks whether all the .proto files of a directory declare the same package.0.9.0
enum-comment-definedThis rule checks whether every enum of a Protobuf file has a leading comment.0.9.0
enum-namingThis rule checks whether the name of every enum of a Protobuf file is in PascalCase.0.9.0
enum-no-allow-aliasThis rule checks whether any enum sets the allow_alias option.0.9.0
enum-value-comment-definedThis rule checks whether every enum value of a Protobuf file has a leading comment.0.9.0
enum-value-namingThis rule checks whether the name of every enum value of a Protobuf file is in UPPER_SNAKE_CASE.0.9.0
enum-value-prefixThis 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-suffixThis rule checks whether the zero value of every enum ends with a suffix, _UNSPECIFIED by default.0.9.0
field-comment-definedThis rule checks whether every field of a Protobuf file has a leading comment.0.9.0
field-namingThis rule checks whether the name of every field of a Protobuf file is in lower_snake_case.0.9.0
file-namingThis rule checks whether the name of every Protobuf file is in lower_snake_case, with the .proto extension.0.9.0
import-no-cycleThis rule checks whether Protobuf files import each other in a cycle.0.9.0
import-no-publicThis rule checks whether a Protobuf file uses import public.0.9.0
import-no-weakThis rule checks whether a Protobuf file uses import weak.0.9.0
import-resolvedThis rule checks whether every file imported by a Protobuf file can be found.0.9.0
import-usedThis rule checks whether every file imported by a Protobuf file is actually used.0.9.0
imports-sortedThis rule checks whether the import statements of a Protobuf file are sorted by path.0.9.0
message-comment-definedThis rule checks whether every message of a Protobuf file has a leading comment.0.9.0
message-namingThis rule checks whether the name of every message of a Protobuf file is in PascalCase.0.9.0
oneof-comment-definedThis rule checks whether every oneof of a Protobuf file has a leading comment.0.9.0
oneof-namingThis rule checks whether the name of every oneof of a Protobuf file is in lower_snake_case.0.9.0
package-definedThis rule checks whether every Protobuf file declares a package.0.9.0
package-directory-matchThis 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-namingThis 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-cycleThis rule checks whether packages import each other in a cycle.0.9.0
package-options-consistentThis 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-directoryThis rule checks whether all the files of a package are in the same directory.0.9.0
package-version-suffixThis 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-definedThis rule checks whether every RPC of a Protobuf file has a leading comment.0.9.0
rpc-namingThis rule checks whether the name of every RPC of a Protobuf file is in PascalCase.0.9.0
rpc-no-client-streamingThis rule checks whether any RPC uses client streaming.0.9.0
rpc-no-server-streamingThis rule checks whether any RPC uses server streaming.0.9.0
rpc-request-response-uniqueThis rule checks whether every message is used as the request or the response of a single RPC.0.9.0
rpc-request-standard-nameThis 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-nameThis 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-definedThis rule checks whether every service of a Protobuf file has a leading comment.0.9.0
service-namingThis rule checks whether the name of every service of a Protobuf file is in PascalCase.0.9.0
service-suffixThis rule checks whether the name of every service ends with a suffix, Service by default.0.9.0
spell-checkThis rule checks the spelling of the comments of a Protobuf file.0.9.0