Skip to content

Commit

Permalink
fix: Stop propagation of annotation to next parameter in signature te…
Browse files Browse the repository at this point in the history
…mplate

Issue #110: #110
  • Loading branch information
pawamoy committed Sep 28, 2023
1 parent 2d7c3fc commit 3a760ac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
)
-%}

{%- if config.show_signature_annotations -%}
{%- set ns.equal = " = " -%}
{%- endif -%}

(
{%- for parameter in function.parameters -%}
{%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%}
Expand All @@ -31,13 +27,17 @@
{%- endif -%}

{%- if config.show_signature_annotations and parameter.annotation is not none -%}
{%- set ns.equal = " = " -%}
{%- if config.separate_signature and config.signature_crossrefs -%}
{%- with expression = parameter.annotation -%}
{%- set ns.annotation -%}: {% include "expression.html" with context %}{%- endset -%}
{%- endwith -%}
{%- else -%}
{%- set ns.annotation = ": " + parameter.annotation|safe -%}
{%- endif -%}
{%- else -%}
{%- set ns.equal = "=" -%}
{%- set ns.annotation = "" -%}
{%- endif -%}

{%- if parameter.default is not none and parameter.kind.value != "variadic positional" and parameter.kind.value != "variadic keyword" -%}
Expand Down

0 comments on commit 3a760ac

Please sign in to comment.