Uh oh!
There was an error while loading. Please reload this page.
feat(gazelle): python_proto_naming_convention directive controls py_proto_library naming - #3093
Conversation
Uh oh!
There was an error while loading. Please reload this page.
dougthor42
left a comment
There was a problem hiding this comment.
Nice! I tested this on our monorepo and generated 227 py_proto_library targets. Hot damn!
There are a variety of nits and requests but otherwise this is looking great, thanks!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… violate the naming convention, and adjust behaviour to match
Uh oh!
There was an error while loading. Please reload this page.
Closes#3081.
This adds support in the Gazelle plugin for controlling how the generated
py_proto_libraryrules are named; support for these was originally added in #3057. We do this via a new Gazelle directive,python_proto_naming_convention, which is similar topython_library_naming_conventionand the like, except it interpolates$proto_name$, which is theproto_libraryrule minus any trailing_proto. We default to$proto_name$_py_pb2.For instance, for a
proto_librarynamedfoo_proto, the default value would generatefoo_py_pb2, aligning with the convention stated in the Bazel docs.