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

Google docs to reST difficulties with arg type + description #89

Open
tristanlatr opened this issue Oct 9, 2020 · 3 comments
Open

Google docs to reST difficulties with arg type + description #89

tristanlatr opened this issue Oct 9, 2020 · 3 comments

Comments

@tristanlatr
Copy link

tristanlatr commented Oct 9, 2020

Hello,

I'm trying to convert automatically google docstrings to reST but not all infos seem to be parsed.

The description do not show up in the patch when the argument type is specified in the parenthesis. Only the type and the default value actually appears.

Any help would be appreciated!

Thanks :)

The following code

def qry_load_data(self, retry=1, wait_timeout_sec=120):
    """
    Internal

    Helper method to execute the query and load the data:
        - Submit the query
        - Wait the query to be executed
        - Get and parse the events

    Arguments:
        retry (int): number of time the query can be failed and retried
        wait_timeout_sec (int): wait timeout in seconds

    Returns: 
        tuple: (`msiempy.event.EventManager`, Query completed? `bool`)

    Raises:
        msiempy.core.session.NitroError if any unhandled errors.
        TimeoutError if wait_timeout_sec counter gets to 0.
    """
    pass

Generate the following patch

# Patch generated by Pyment v0.3.3

--- a/test.py
+++ b/test.py
@@ -1,21 +1,16 @@
 def qry_load_data(self, retry=1, wait_timeout_sec=120):
-    """
-    Internal
-
+    """Internal
+    
     Helper method to execute the query and load the data:
         - Submit the query
         - Wait the query to be executed
         - Get and parse the events
 
-    Arguments:
-        retry (int): number of time the query can be failed and retried
-        wait_timeout_sec (int): wait timeout in seconds
+    :param retry: int (Default value = 1)
+    :param wait_timeout_sec: int (Default value = 120)
+    :returns: tuple: (`msiempy.event.EventManager`, Query completed? `bool`)
+    :raises msiempy.core.session.NitroError: if any unhandled errors
+    :raises TimeoutError: if wait_timeout_sec counter gets to 0
 
-    Returns: 
-        tuple: (`msiempy.event.EventManager`, Query completed? `bool`)
-
-    Raises:
-        msiempy.core.session.NitroError if any unhandled errors.
-        TimeoutError if wait_timeout_sec counter gets to 0.
     """
     pass
@Trezorro
Copy link

+1 for related issue.
The other way around doesn't generate docstrings with parentheses, which doesn't match google's style guide it seems.

@dadadel
Copy link
Owner

dadadel commented Feb 20, 2021

Hi! thanks for reporting, I'll get a look.

@dadadel
Copy link
Owner

dadadel commented Feb 20, 2021

This issue seems related to issue #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants