Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

### 2021-04-07 - 5.6.6

min Autorest core version: 3.1.0

min Modelerfour version: 4.15.456

**Bug Fixes**

- Fix docstrings so they don't get split on hyphens #931

### 2021-04-07 - 5.6.5

min Autorest core version: 3.1.0
Expand Down
4 changes: 2 additions & 2 deletions autorest/codegen/templates/enum.py.jinja2
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

class {{ enum.name }}(with_metaclass(_CaseInsensitiveEnumMeta, {{ enum.enum_type.type_annotation }}, Enum)):
{% if enum.description %}
"""{{ enum.description | wordwrap(width=95, break_long_words=False, wrapstring='\n ') }}
"""{{ enum.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
"""
{% endif %}

{% for value in enum.values %}
{% if value.description %}
#: {{ value.description | wordwrap(width=95, break_long_words=False, wrapstring='\n #: ') }}
#: {{ value.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n #: ') }}
{% endif %}
{{ value.name }} = {{ enum.enum_type.get_declaration(value.value) }}
{% endfor %}
6 changes: 3 additions & 3 deletions autorest/codegen/templates/lro_operation_helper.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

{% macro operation_docstring_helper(code_model, operation, async_mode) %}
{% import 'keywords.jinja2' as keywords with context %}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% if operation.summary and operation.description %}

{{ operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
{{ operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% endif %}

{% if operation.deprecated -%}
Expand All @@ -17,7 +17,7 @@
{% endif -%}
{% for parameter in operation.parameters.method %}
{%- for doc_string in param_documentation_string(parameter).replace('\n', '\n ').split('\n') %}
{{ doc_string | wordwrap(width=95, break_long_words=False, wrapstring='\n ')}}
{{ doc_string | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ')}}
{% endfor %}
:type {{ parameter.serialized_name }}: {{ parameter.docstring_type }}
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions autorest/codegen/templates/model.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class {{ model.name }}(msrest.serialization.Model):
{% if model.properties != None %}
{% for p in model.properties %}
{% for doc_string in prop_documentation_string(p).replace('\n', '\n ').split('\n') %}
{{ doc_string | wordwrap(width=95, break_long_words=False, wrapstring='\n ') }}
{{ doc_string | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
{% endfor %}
{{ prop_type_documentation_string(p) | wordwrap(width=95, break_long_words=False, wrapstring='\n ') }}
{{ prop_type_documentation_string(p) | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ') }}
{% endfor %}
{% endif %}
"""
Expand Down
6 changes: 3 additions & 3 deletions autorest/codegen/templates/operation.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
{%- endif -%}
{% endmacro %}
{% macro operation_docstring(async_mode, return_type=None) %}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% if operation.summary and operation.description %}

{{ operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
{{ operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% endif %}

{% if operation.deprecated -%}
Expand All @@ -33,7 +33,7 @@
{% endif -%}
{% for parameter in operation.parameters.method %}
{%- for doc_string in param_documentation_string(parameter).replace('\n', '\n ').split('\n') %}
{{ doc_string | wordwrap(width=95, break_long_words=False, wrapstring='\n ')}}
{{ doc_string | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ')}}
{% endfor %}
:type {{ parameter.serialized_name }}: {{ parameter.docstring_type }}
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions autorest/codegen/templates/paging_operation.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
:return: None
:rtype: None{%- endif -%}{%- endmacro -%}
{% macro operation_docstring(async_mode) %}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
"""{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% if operation.summary and operation.description %}

{{ operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }}
{{ operation.description | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n') }}
{% endif %}

{% if operation.deprecated -%}
Expand All @@ -23,7 +23,7 @@
{% endif -%}
{% for parameter in operation.parameters.method %}
{%- for doc_string in param_documentation_string(parameter).replace('\n', '\n ').split('\n') %}
{{ doc_string | wordwrap(width=95, break_long_words=False, wrapstring='\n ')}}
{{ doc_string | wordwrap(width=95, break_long_words=False, break_on_hyphens=False, wrapstring='\n ')}}
{% endfor %}
:type {{ parameter.serialized_name }}: {{ parameter.docstring_type }}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/python",
"version": "5.6.5",
"version": "5.6.6",
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"prepare": "node run-python3.js prepare.py",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ async def post_method_local_valid(self, subscription_id: str, **kwargs) -> None:

@distributed_trace_async
async def post_method_local_null(self, subscription_id: str, **kwargs) -> None:
"""POST method with subscriptionId modeled in the method. pass in subscription id = null, client-
side validation should prevent you from making this call.
"""POST method with subscriptionId modeled in the method. pass in subscription id = null,
client-side validation should prevent you from making this call.

:param subscription_id: This should appear as a method parameter, use value null, client-side
validation should prvenet the call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def post_method_local_null(
**kwargs # type: Any
):
# type: (...) -> None
"""POST method with subscriptionId modeled in the method. pass in subscription id = null, client-
side validation should prevent you from making this call.
"""POST method with subscriptionId modeled in the method. pass in subscription id = null,
client-side validation should prevent you from making this call.

:param subscription_id: This should appear as a method parameter, use value null, client-side
validation should prvenet the call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,8 @@ def get_paging_model_with_item_name_with_xms_client_name(
self,
**kwargs
) -> AsyncIterable["_models.ProductResultValueWithXMSClientName"]:
"""A paging operation that returns a paging model whose item name is is overriden by x-ms-client-
name 'indexes'.
"""A paging operation that returns a paging model whose item name is is overriden by
x-ms-client-name 'indexes'.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,8 @@ def get_paging_model_with_item_name_with_xms_client_name(
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ProductResultValueWithXMSClientName"]
"""A paging operation that returns a paging model whose item name is is overriden by x-ms-client-
name 'indexes'.
"""A paging operation that returns a paging model whose item name is is overriden by
x-ms-client-name 'indexes'.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ async def begin_put_async_retry_succeeded(
) -> AsyncLROPoller["_models.Product"]:
"""x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for
all requests. Long running put request, service returns a 200 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down Expand Up @@ -410,8 +410,8 @@ async def begin_post_async_retry_succeeded(
) -> AsyncLROPoller[None]:
"""x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for
all requests. Long running post request, service returns a 202 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ async def begin_put_async_relative_retry_succeeded(
self, product: Optional["_models.Product"] = None, **kwargs
) -> AsyncLROPoller["_models.Product"]:
"""Long running put request, service returns a 500, then a 200 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down Expand Up @@ -666,8 +666,8 @@ async def begin_post_async_relative_retry_succeeded(
self, product: Optional["_models.Product"] = None, **kwargs
) -> AsyncLROPoller[None]:
"""Long running post request, service returns a 500, then a 202 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1536,9 +1536,9 @@ async def _put_async_no_header_in_retry_initial(
async def begin_put_async_no_header_in_retry(
self, product: Optional["_models.Product"] = None, **kwargs
) -> AsyncLROPoller["_models.Product"]:
"""Long running put request, service returns a 202 to the initial request with Azure-
AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation
header.
"""Long running put request, service returns a 202 to the initial request with
Azure-AsyncOperation header. Subsequent calls to operation status do not contain
Azure-AsyncOperation header.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def begin_put_async_retry_succeeded(
# type: (...) -> LROPoller["_models.Product"]
"""x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for
all requests. Long running put request, service returns a 200 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down Expand Up @@ -440,8 +440,8 @@ def begin_post_async_retry_succeeded(
# type: (...) -> LROPoller[None]
"""x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for
all requests. Long running post request, service returns a 202 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def begin_put_async_relative_retry_succeeded(
):
# type: (...) -> LROPoller["_models.Product"]
"""Long running put request, service returns a 500, then a 200 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down Expand Up @@ -710,8 +710,8 @@ def begin_post_async_relative_retry_succeeded(
):
# type: (...) -> LROPoller[None]
"""Long running post request, service returns a 500, then a 202 to the initial request, with an
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-
AsyncOperation header for operation status.
entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the
Azure-AsyncOperation header for operation status.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1620,9 +1620,9 @@ def begin_put_async_no_header_in_retry(
**kwargs # type: Any
):
# type: (...) -> LROPoller["_models.Product"]
"""Long running put request, service returns a 202 to the initial request with Azure-
AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation
header.
"""Long running put request, service returns a 202 to the initial request with
Azure-AsyncOperation header. Subsequent calls to operation status do not contain
Azure-AsyncOperation header.

:param product: Product to put.
:type product: ~lro.models.Product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,8 @@ async def internal_get_next(next_link=None):
def get_paging_model_with_item_name_with_xms_client_name(
self, **kwargs
) -> AsyncIterable["_models.ProductResultValueWithXMSClientName"]:
"""A paging operation that returns a paging model whose item name is is overriden by x-ms-client-
name 'indexes'.
"""A paging operation that returns a paging model whose item name is is overriden by
x-ms-client-name 'indexes'.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,8 @@ def get_paging_model_with_item_name_with_xms_client_name(
self, **kwargs # type: Any
):
# type: (...) -> Iterable["_models.ProductResultValueWithXMSClientName"]
"""A paging operation that returns a paging model whose item name is is overriden by x-ms-client-
name 'indexes'.
"""A paging operation that returns a paging model whose item name is is overriden by
x-ms-client-name 'indexes'.

:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response)
Expand Down
Loading