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

"Returns" section of google docstrings resembles numpy style #232

Open
ubalklen opened this issue Apr 3, 2022 · 0 comments · May be fixed by #254
Open

"Returns" section of google docstrings resembles numpy style #232

ubalklen opened this issue Apr 3, 2022 · 0 comments · May be fixed by #254
Labels

Comments

@ubalklen
Copy link

ubalklen commented Apr 3, 2022

Describe the bug

The current template for google docstring's Returns section is as follows:

    Returns:
        _type_: _description_

The Google Python Style Guide suggests a sentence like A dict mapping keys to the corresponding table row data fetched. instead of these type os structures.

Worse still, in case the return value is a tuple, the current template suggests _type_: _description_ blocks should be added to describe each value, in the same way numpy style does. But the numpy pattern is explicitly forbidden by the style guide.

The template should be more google-esque or, at least, less numpy-esque.

Versions (please complete the following information):

  • autoDocstring Version: 0.6.1
  • Operating System: Windows 10
  • Vscode Version: 1.66.0

Original Code (with line to generate on):

def foo():
    # generate on this line
    return 1, "two"

Expected Result:

def foo():
    """_summary_

    Returns:
        _description_
    """
    return 1, "two"

or

def foo():
    """_summary_

    Returns:
        A _type_
    """
    return 1, "two"

Actual Result:

def foo():
    """_summary_

    Returns:
        _type_: _description_
    """
    return 1, "two"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant