You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have some best practices in our org that we would want to enforce on specific types users should use for primitives or wrapper types such as StringValue.
Would it be possible for Buf to add support for some custom rules which could be configured to allow enforcing all int64 types are sint64 for example?
If this could be configurable that would be great. The granularity would be to disallow certain datatypes from appearing or another way could be doing an allowed type list as well (StringValue, IntValue, sint64, etc).
This would help us enforce these rules through automation rather than through documentation, word of mouth or PR review.
The text was updated successfully, but these errors were encountered:
I think this would be a great addition to be able to configure "undesirable" types. For example the use of google.protobuf.Struct or google.protobuf.Any might not be desired for particular applications, as it introduces ambiguity, and might want to be prevented in particular design scenarios.
If there was a configurable linter option to provide a list of disallowed types, it would help a lot.
bufdev
changed the title
[Lint] Enforce specific type usage in Proto files
Enforce specific type usage via lint
Jul 31, 2021
Currently we have some best practices in our org that we would want to enforce on specific types users should use for primitives or wrapper types such as
StringValue
.Would it be possible for Buf to add support for some custom rules which could be configured to allow enforcing all int64 types are
sint64
for example?There are many types in Protobuf 3 which leads to confusion and bad decisions taken on part by an unsuspecting user (see https://stackoverflow.com/questions/765916/is-there-ever-a-good-time-to-use-int32-instead-of-sint32-in-google-protocol-buff).
If this could be configurable that would be great. The granularity would be to disallow certain datatypes from appearing or another way could be doing an allowed type list as well (
StringValue
,IntValue
,sint64
, etc).This would help us enforce these rules through automation rather than through documentation, word of mouth or PR review.
The text was updated successfully, but these errors were encountered: