dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

Multi-line args descriptions are not indented correctly #76

Open jethrokuan opened 5 years ago

jethrokuan commented 5 years ago

Here's an example that illustrates the issue.

def foo(baz=1):
    """

    Args:
      baz: long-description breaking into multiple
        lines (Default value = 1)

    Returns:

    """
    pass

Formatting under google style results in:

def foo(baz=1):
    """

    Args:
      baz: long-description breaking into multiple
    lines (Default value = 1)

    Returns:

    """
    pass

where the second line of the arg description is indented incorrectly.

introt commented 3 years ago

~Same problem with rst, the subsequent lines have the same indentation as the field while they should be indented: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#field-lists~

Edit: 0.4.0dev indents the lines correctly under rst style