Repository: heavenshell/py-doq

Issue:
methods with multi-line arguments
Similar of #51, but here the multi-line arguments cannot be processed.

![image](https://user-images.githubusercontent.com/9496702/130314277-8ec308a0-3ac7-46d7-8a43-b4d3cfeb95b9.png)


Comments:

Patch:
diff --git a/doq/outputter.py b/doq/outputter.py
index 8fe6de7..a676c42 100644
--- a/doq/outputter.py
+++ b/doq/outputter.py
@@ -17,9 +17,9 @@ class StringOutptter(BaseOutputter):
                 if line.endswith('):'):
                     # Found end of signature without type
                     return start + i + 1
-                elif re.search(r'\):', line):
+                elif re.search(r'\):|\)\s*:', line):
                     return start + i + 1
-                elif re.search(r'\]:', line):
+                elif re.search(r'\]:|\]\s*:', line):
                     # Found end of signature type
                     #   def foo(a, b) -> Tuple[
                     #       int,


Test patch:
diff --git a/tests/test_outputter.py b/tests/test_outputter.py
index 5368858..4cb5d69 100644
--- a/tests/test_outputter.py
+++ b/tests/test_outputter.py
@@ -71,6 +71,77 @@ class StringOutptterTestCase(TestCase):
         ])
         self.assertEqual(expected, output)
 
+    def test_multi_lines_with_space(self):
+        lines = [
+            'def foo(',
+            '    arg1,',
+            '    arg2,',
+            '    arg3,',
+            ') :',
+            '    pass',
+        ]
+
+        docstrings = [{
+            'docstring': '"""foo.\n\n:param arg1:\n:param arg2:\n:param arg3:\n"""',
+            'start_lineno': 1,
+            'start_col': 0,
+            'end_lineno': 8,
+            'end_col': 0,
+            'is_doc_exists': False,
+        }]
+        output = StringOutptter().format(lines=lines, docstrings=docstrings, indent=4)
+        expected = '\n'.join([
+            'def foo(',
+            '    arg1,',
+            '    arg2,',
+            '    arg3,',
+            ') :',
+            '    """foo.',
+            '',
+            '    :param arg1:',
+            '    :param arg2:',
+            '    :param arg3:',
+            '    """',
+            '    pass',
+        ])
+        self.assertEqual(expected, output)
+
+    def test_multi_lines_with_space_and_return_type(self):
+        lines = [
+            'def foo(',
+            '    arg1,',
+            '    arg2,',
+            '    arg3,',
+            ') -> int :',
+            '    pass',
+        ]
+
+        docstrings = [{
+            'docstring': '"""foo.\n\n:param arg1:\n:param arg2:\n:param arg3:\n:rtype: int\n"""',
+            'start_lineno': 1,
+            'start_col': 0,
+            'end_lineno': 8,
+            'end_col': 0,
+            'is_doc_exists': False,
+        }]
+        output = StringOutptter().format(lines=lines, docstrings=docstrings, indent=4)
+        expected = '\n'.join([
+            'def foo(',
+            '    arg1,',
+            '    arg2,',
+            '    arg3,',
+            ') -> int :',
+            '    """foo.',
+            '',
+            '    :param arg1:',
+            '    :param arg2:',
+            '    :param arg3:',
+            '    :rtype: int',
+            '    """',
+            '    pass',
+        ])
+        self.assertEqual(expected, output)
+
     def test_multi_lines_with_return_type(self):
         lines = [
             'def foo(',