We have released Buf v0.15.0.
This release allows you to use comment-driven lint ignores. To enable, add the following to your buf.yaml configuration file:
lint:
allow_comment_ignores: true
If this option is set, leading comments can be added within Protobuf files to ignore lint errors for certain components. If any line in a leading comment starts with buf:lint:ignore ID, then Buf will ignore lint errors for this ID. For example:
syntax = "proto3";
// buf:lint:ignore PACKAGE_LOWER_SNAKE_CASE
// buf:lint:ignore PACKAGE_VERSION_SUFFIX
package A;
For most situations, we do not recommend enabling this option. If this option is enabled, individual engineers within an organization can decide on their own lint exceptions, leading to inconsistencies across your Protobuf definitions - which of course is what buf check lint is helping you avoid! However, there are certain situations (such as migrations) when such functionality is useful, and we want users to be able to make informed, opt-in decisions. Therefore, we've added this option for such situations, and we hope it helps in such cases.
Thanks for your continued support of Buf!