-
-
Notifications
You must be signed in to change notification settings - Fork 637
feat(gazelle): python_proto_naming_convention directive controls py_proto_library naming
#3093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gazelle): python_proto_naming_convention directive controls py_proto_library naming
#3093
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
gazelle/python/testdata/directive_python_proto_naming_convention/README.md
Outdated
Show resolved
Hide resolved
gazelle/python/testdata/directive_python_proto_naming_convention/README.md
Outdated
Show resolved
Hide resolved
gazelle/python/testdata/directive_python_proto_naming_convention/README.md
Outdated
Show resolved
Hide resolved
… violate the naming convention, and adjust behaviour to match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
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.