pyment icon indicating copy to clipboard operation
pyment copied to clipboard

javadoc: @returns get parsed incorrectly

Open thughes opened this issue 4 years ago • 2 comments

Example:

def method(self):
    """Short description

    @returns: some return val
    """
    pass

Gets converted to:

def method(self):
    """Short description

    Returns:
        s: some return val
    """
    pass

thughes avatar Nov 18 '19 19:11 thughes

Hi @thughes Indeed it seems that when "return' is written with an ending "s" it pyment will consider it as a kind of parameter. This should be addressed.

dadadel avatar Nov 19 '19 12:11 dadadel

The current pip version (0.3.3?) exhibits the behavior reported above, while the current git version adds another, indented @returns: line as well!

@param name: param desc
@returns: return desc
"""

Turns into this:

:param name: param desc
   @returns: return desc
:returns: s: return desc
"""

That extra line's indentation is also wrong: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#field-lists, but that's

introt avatar Jun 12 '21 17:06 introt