Open ngbrown opened 3 weeks ago
The 1-1-1 methodology sounds impractical, and isn't something we would recommend to our users at all. To start with, you shouldn't be moving files generally - doing so can cause breaking changes in source code. Moving files wouldn't be a concern at Google though, but that gets to the point: 1-1-1 feels like something for Google, but not for the rest of us.
Regardless, reasonable people can disagree, which is why we are currently working on buf plugins for lint and breaking change detection! This will let you write your own rules, including for rules that the Buf team disagrees with. We will keep you up to date when this is available!
Feature
The Protocol Buffers Documentation has in their guide the 1-1-1 Rule:
proto_library
rule.proto
fileAnd states: "When defining a proto schema, you should have a single message, enum, extension, service, or group of cyclic dependencies per file."
It would be great if the
buf lint
command would check for this. It would be fairly straight forward for oneenum
orservice
per file. For messages that are cyclic, it could be a bit more challenging, but I've never made such a message, so most messages should be one per file.