dadadel / pyment

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

support Raises: section #39

Closed graik closed 3 years ago

graik commented 7 years ago

feature request: convert :raise reST statement to Raises: section in google doc style.

dadadel commented 7 years ago

Hi @graik, Pyment is supposed to manage raise and thus to convert from reST to google. Can you provide an example? I will try to fix this.

dadadel commented 3 years ago

I close this issue as raise seems to work. For instance:

def func1(param1):
    """Description

    :param param1: foo
    :raises Exception: my exception
    :returns: the return value
    """
    pass

Will produce:

 def func1(param1):
     """Description

-    :param param1: foo
-    :raises Exception: my exception
-    :returns: the return value
+    Args:
+      param1: foo
+
+    Returns:
+      the return value
+
+    Raises:
+      Exception my exception
+
     """
     pass