Closed
Description
This line https://github.com/danielgtaylor/python-betterproto/blob/master/src/betterproto/templates/template.py.j2#L49 formats the comments on class attributes like this.
With the example from the readme:
// This is the class docstring
message EchoRequest {
string value = 1;
// This is a field docstring
uint32 extra_times = 2;
}
It generates this Python code:
@dataclass
class EchoRequest(betterproto.Message):
"""This is the class docstring"""
value: str = betterproto.string_field(1)
# This is a field docstring
extra_times: int = betterproto.uint32_field(2)
But a slightly different formatting would make it a docstring recognized by IDEs:
class EchoRequest(betterproto.Message):
"""This is the class docstring"""
value: str = betterproto.string_field(1)
extra_times: int = betterproto.uint32_field(2)
"""This is a field docstring"""
Would you mind changing the formatting here? Or are there specific reasons why it produces the current output format?
Metadata
Metadata
Assignees
Labels
No labels