You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GoogleParser fails to parse multi-line parameter definitions correctly #97
deftest_google_parser_multi_line_parameter_type() ->None:
parser=GoogleParser()
docstring=parser.parse(
"""Description of the function. Args: output_type (Literal["searchResults", "sourcedAnswer", "structured"]): The type of output. This can be one of the following: - "searchResults": Represents the search results. - "sourcedAnswer": Represents a sourced answer. - "structured": Represents a structured output format. Returns: bool: Indicates success or failure. """
)
assertdocstring.params[0].arg_name=="output_type"
Output
docstring_parser/tests/test_google.py:45 (test_google_parser_multi_line_parameter_type)
'output_type (Literal["searchResults", "sourcedAnswer",\n "structured"])'!= 'output_type'
Expected :'output_type'
Actual :'output_type (Literal["searchResults", "sourcedAnswer",\n "structured"])'<Click to see difference>
Root Cause
In the _build_meta method in docstring_parser/google.py, the code processes the desc (description) part after the colon to handle multi-line formatting, but it doesn't apply the same processing to the before part (parameter name and type) before the colon.
Activity