Format field comments also as docstrings (#304)
Closes #303 * Format field comments also as docstrings To make it clear that they refer to the item above. * Fix placement of enum item docstrings * Add line breaks after class attribute or enum item docstrings
This commit is contained in:
@@ -28,10 +28,11 @@ class {{ enum.py_name }}(betterproto.Enum):
|
||||
|
||||
{% endif %}
|
||||
{% for entry in enum.entries %}
|
||||
{{ entry.name }} = {{ entry.value }}
|
||||
{% if entry.comment %}
|
||||
{{ entry.comment }}
|
||||
|
||||
{% endif %}
|
||||
{{ entry.name }} = {{ entry.value }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -45,10 +46,11 @@ class {{ message.py_name }}(betterproto.Message):
|
||||
|
||||
{% endif %}
|
||||
{% for field in message.fields %}
|
||||
{{ field.get_field_string() }}
|
||||
{% if field.comment %}
|
||||
{{ field.comment }}
|
||||
|
||||
{% endif %}
|
||||
{{ field.get_field_string() }}
|
||||
{% endfor %}
|
||||
{% if not message.fields %}
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user