buf.policy.yaml
buf.policy.yaml defines a policy containing lint, breaking change detection, and plugin configuration that can be shared across BSR modules
| Type | object |
|---|---|
| File match |
buf.policy.yaml
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/buf-policy-yaml/latest.json |
| Source | https://www.schemastore.org/buf.policy.json |
Validate with Lintel
npx @lintel/lintel check
buf.policy.yaml defines a policy containing a subset of Buf configuration focused on lint, breaking change detection, and plugins. Policies can be shared across modules in the Buf Schema Registry.
Properties
Required. The version key defines the current configuration version. The only accepted value is v2.
Optional. A BSR path that uniquely identifies this policy. Must be a valid policy name in the format buf.build/ORGANIZATION/POLICY_NAME.
Optional. The lint settings for this policy.
8 nested properties
Optional. Lists the categories and/or specific rules to use. The STANDARD category is used if lint is unset.
[
"STANDARD"
]
Optional. Removes rules or categories from the use list.
Optional. Controls the behavior of the ENUM_ZERO_VALUE_SUFFIX lint rule. By default, this rule verifies that the zero value of all enums ends in _UNSPECIFIED.
Optional. Allows the same message type to be used for a single RPC's request and response type. We don't recommend using this option.
Optional. Allows RPC requests to be google.protobuf.Empty messages. We don't recommend using this option.
Optional. Allows RPC responses to be google.protobuf.Empty messages. We don't recommend using this option.
Optional. Controls the behavior of the SERVICE_SUFFIX lint rule. By default, this rule verifies that all service names are suffixed with Service.
Optional. Disables Buf's built-in lint rules when set to true. Defaults to false.
Optional. The breaking change detection settings for this policy.
4 nested properties
Optional. Lists the rules or categories to use for breaking change detection. The FILE category is used if breaking is unset.
[
"FILE"
]
Optional. Removes rules or categories from the use list. We don't recommend using this option.
Optional. Ignores packages with a last component that's one of the unstable forms recognized by the Buf linter's PACKAGE_VERSION_SUFFIX rule.
Optional. Disables Buf's built-in breaking change detection rules when set to true. Defaults to false.
Optional. Custom Buf plugins that provide additional lint or breaking change rules.
Definitions
"STANDARD""DEFAULT""BASIC""MINIMAL""COMMENTS""UNARY_RPC""DIRECTORY_SAME_PACKAGE""PACKAGE_DEFINED""PACKAGE_DIRECTORY_MATCH""PACKAGE_SAME_DIRECTORY""ENUM_PASCAL_CASE""ENUM_VALUE_UPPER_SNAKE_CASE""FIELD_LOWER_SNAKE_CASE""MESSAGE_PASCAL_CASE""ONEOF_LOWER_SNAKE_CASE""PACKAGE_LOWER_SNAKE_CASE""RPC_PASCAL_CASE""SERVICE_PASCAL_CASE""PACKAGE_SAME_CSHARP_NAMESPACE""PACKAGE_SAME_GO_PACKAGE""PACKAGE_SAME_JAVA_MULTIPLE_FILES""PACKAGE_SAME_JAVA_PACKAGE""PACKAGE_SAME_PHP_NAMESPACE""PACKAGE_SAME_RUBY_PACKAGE""PACKAGE_SAME_SWIFT_PREFIX""ENUM_FIRST_VALUE_ZERO""ENUM_NO_ALLOW_ALIAS""IMPORT_NO_WEAK""IMPORT_NO_PUBLIC""IMPORT_USED""ENUM_VALUE_PREFIX""ENUM_ZERO_VALUE_SUFFIX""FIELD_NOT_REQUIRED""FILE_LOWER_SNAKE_CASE""RPC_REQUEST_RESPONSE_UNIQUE""RPC_REQUEST_STANDARD_NAME""RPC_RESPONSE_STANDARD_NAME""PACKAGE_VERSION_SUFFIX""PROTOVALIDATE""SERVICE_SUFFIX""COMMENT_ENUM""COMMENT_ENUM_VALUE""COMMENT_FIELD""COMMENT_MESSAGE""COMMENT_ONEOF""COMMENT_RPC""COMMENT_SERVICE""RPC_NO_CLIENT_STREAMING""RPC_NO_SERVER_STREAMING""PACKAGE_NO_IMPORT_CYCLE""SYNTAX_SPECIFIED""STABLE_PACKAGE_NO_IMPORT_UNSTABLE"
"FILE""PACKAGE""WIRE_JSON""WIRE""ENUM_NO_DELETE""ENUM_SAME_JSON_FORMAT""ENUM_SAME_TYPE""ENUM_VALUE_NO_DELETE""ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED""ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED""ENUM_VALUE_SAME_NAME""EXTENSION_MESSAGE_NO_DELETE""EXTENSION_NO_DELETE""FIELD_NO_DELETE""FIELD_NO_DELETE_UNLESS_NAME_RESERVED""FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED""FIELD_SAME_CARDINALITY""FIELD_SAME_CPP_STRING_TYPE""FIELD_SAME_CTYPE""FIELD_SAME_DEFAULT""FIELD_SAME_JAVA_UTF8_VALIDATION""FIELD_SAME_JSON_NAME""FIELD_SAME_JSTYPE""FIELD_SAME_LABEL""FIELD_SAME_NAME""FIELD_SAME_ONEOF""FIELD_SAME_TYPE""FIELD_SAME_UTF8_VALIDATION""FIELD_WIRE_COMPATIBLE_CARDINALITY""FIELD_WIRE_COMPATIBLE_TYPE""FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY""FIELD_WIRE_JSON_COMPATIBLE_TYPE""FILE_NO_DELETE""FILE_SAME_CC_ENABLE_ARENAS""FILE_SAME_CC_GENERIC_SERVICES""FILE_SAME_CSHARP_NAMESPACE""FILE_SAME_GO_PACKAGE""FILE_SAME_JAVA_GENERIC_SERVICES""FILE_SAME_JAVA_MULTIPLE_FILES""FILE_SAME_JAVA_OUTER_CLASSNAME""FILE_SAME_JAVA_PACKAGE""FILE_SAME_JAVA_STRING_CHECK_UTF8""FILE_SAME_OBJC_CLASS_PREFIX""FILE_SAME_OPTIMIZE_FOR""FILE_SAME_PACKAGE""FILE_SAME_PHP_CLASS_PREFIX""FILE_SAME_PHP_GENERIC_SERVICES""FILE_SAME_PHP_METADATA_NAMESPACE""FILE_SAME_PHP_NAMESPACE""FILE_SAME_PY_GENERIC_SERVICES""FILE_SAME_RUBY_PACKAGE""FILE_SAME_SWIFT_PREFIX""FILE_SAME_SYNTAX""MESSAGE_NO_DELETE""MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR""MESSAGE_SAME_JSON_FORMAT""MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT""MESSAGE_SAME_REQUIRED_FIELDS""ONEOF_NO_DELETE""PACKAGE_ENUM_NO_DELETE""PACKAGE_EXTENSION_NO_DELETE""PACKAGE_MESSAGE_NO_DELETE""PACKAGE_NO_DELETE""PACKAGE_SERVICE_NO_DELETE""RESERVED_ENUM_NO_DELETE""RESERVED_MESSAGE_NO_DELETE""RPC_NO_DELETE""RPC_SAME_CLIENT_STREAMING""RPC_SAME_IDEMPOTENCY_LEVEL""RPC_SAME_REQUEST_TYPE""RPC_SAME_RESPONSE_TYPE""RPC_SAME_SERVER_STREAMING""SERVICE_NO_DELETE"