Skip to content

Commit

Permalink
Don't put spurious leading semicolon in param doc when Param.allowed_…
Browse files Browse the repository at this point in the history
…types is empty

When expanding these templates, param.type is empty if the type is not specified for that Param in the StarlarkMethod annotation. For example, that's currently showing up for many of the params on attr methods:
https://docs.bazel.build/versions/master/skylark/lib/attr.html

RELNOTES: None.
PiperOrigin-RevId: 344043655
  • Loading branch information
Googler authored and copybara-github committed Nov 24, 2020
1 parent 47e832a commit bf6fc47
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ ${module.documentation}
<code>${param.name}</code>
</td>
<td>
#if (!$param.type.isEmpty())
<code>${param.type}</code>;
#end
#if (!$param.defaultValue.isEmpty())
<code>${param.type}</code>; default = ${param.defaultValue}<br/>
default = ${param.defaultValue}<br/>
#else
<code>${param.type}</code>; required<br/>
required<br/>
#end
${param.documentation}
</td>
Expand Down

0 comments on commit bf6fc47

Please sign in to comment.