If a Google-style docstring has no summary line and opens directly with Args:, parse() in auto mode returns a REST parse with zero params, silently. Explicit style=GOOGLE shows why:
docstring_parser 0.18.0
opens with 'Args:': style=DocstringStyle.REST short='Args:' params=[]
summary line then 'Args:': style=DocstringStyle.GOOGLE short='Send an email.' params=[('to', 'Recipient address.'), ('reason', 'One sentence explaining why this send is warranted.')]
opens with 'Args:' + explicit GOOGLE: ParseError: No specification for "Args": ""
Repro: https://gist.github.com/HardMax71/85992abc250e897dee92d0638cd820e2
Mechanism in docstring_parser/google.py (0.18.0 is the latest, same on master): inspect.cleandoc at line 219 strips the first line's indentation and dedents the rest by the common indent, so when Args: is line 1 the parameter lines lose their indent; the section cut at 261-264 (re.search(r"\n\S", meta_details)) then finds an empty chunk and line 288 raises ParseError. In auto style parser.py:36-48 swallows that and returns the parser with the most meta, which is REST with nothing.
It bites anyone generating tool schemas from docstrings: the descriptions are right there in the source and the model never sees them.
If a Google-style docstring has no summary line and opens directly with
Args:,parse()in auto mode returns a REST parse with zero params, silently. Explicitstyle=GOOGLEshows why:Repro: https://gist.github.com/HardMax71/85992abc250e897dee92d0638cd820e2
Mechanism in
docstring_parser/google.py(0.18.0 is the latest, same on master):inspect.cleandocat line 219 strips the first line's indentation and dedents the rest by the common indent, so whenArgs:is line 1 the parameter lines lose their indent; the section cut at 261-264 (re.search(r"\n\S", meta_details)) then finds an empty chunk and line 288 raisesParseError. In auto styleparser.py:36-48swallows that and returns the parser with the most meta, which is REST with nothing.It bites anyone generating tool schemas from docstrings: the descriptions are right there in the source and the model never sees them.