zwang123 / sphinx-autodoc-defaultargs

Automatic generation of default arguments for the Sphinx autodoc extension.
MIT License
4 stars 0 forks source link

Package breakes on multiline description of parameters #2

Open churnikov opened 3 years ago

churnikov commented 3 years ago

Hello!

Great package, but I have just encountered one problem:

If I write multiline description of parameter:

:param param: param
    param.

I get the following warning:

 WARNING: Unexpected indentation.

and result looks like this

image
zwang123 commented 2 years ago

@churnikov Hello!

Thanks for your support and issue. I have to apologize for late response as my github account was lost and it was recovered recently.

Regarding your issue, I believe this is caused by the incorrect indentation. The package assumes indentation not to be decreased within the same block. You can see the difference between the two examples below.

def func_right(param=-1):
    """
    Example docstring.

    :param param: param
                  param.
    """
    ...

def func_wrong(param=-1):
    """
    Example docstring.

    :param param: param
        param.
    """
    ...

func_right will not complain this warning while func_wrong will, as is the result I obtained on my end.

Could you please modify your code and report the latest result?