Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid the endline when the function does not have params #71

Closed
PaulRBerg opened this issue Dec 8, 2021 · 1 comment
Closed

Avoid the endline when the function does not have params #71

PaulRBerg opened this issue Dec 8, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system

Comments

@PaulRBerg
Copy link
Contributor

Related to #70, but in this case the issue is that even if the function does not params, the generate docs still add an empty line in the code snippet:

function balanceSheet(
) external returns (contract IBalanceSheetV1)

Which should instead be:

function balanceSheet() external returns (contract IBalanceSheetV1)
@PaulRBerg PaulRBerg added documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system labels Dec 8, 2021
@PaulRBerg
Copy link
Contributor Author

Done via 43e08ed.

The trick was to add an extra if:

function {{name}}({{#if params}}
    {{#each params}}
    {{type}} {{name}}{{#if @last}}{{else}},{{/if}}
    {{/each}}
{{/if}}) {{visibility}}{{#if returns}} returns ({{printParams returns}}){{/if}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement Improvement for an existing feature or system
Projects
None yet
Development

No branches or pull requests

1 participant