autoDocstring
autoDocstring copied to clipboard
Issue with quoted type hint (again) this time with quoted hint in return section
Describe the bug The following situation where you have a quoted type hint for the return leads to args to be skipped and return type is not guessed correctly. It's a pretty funky one!
Versions (please complete the following information):
- autoDocstring Version: 0.5.3
- Operating System: OSX Mojave
- Vscode Version: 1.46.1
Original Code (with line to generate on):
def foo(bar: "int", buzz: int) -> "pd.DataFrame":
"""[summary]
Returns:
[type]: [description]
"""
a = bar + buzz
return a
Expected Result:
```python
def foo(bar: "int", buzz: int) -> "pd.DataFrame":
"""[summary]
Args:
bar (int): [description]
buzz (int): [description
Returns:
pd.DataFrame: [description]
"""
a = bar + buzz
return a
**Actual Result:**
```python
def foo(bar: "int", buzz: int) -> "pd.DataFrame":
"""[summary]
Returns:
[type]: [description]
"""
a = bar + buzz
return a
Stack trace:
If an error was reported by autodocstring please copy the stack trace from the autoDocstring output channel.
Additional context Add any other context about the problem here.
Getting exactly the same issue.
- autoDocstring Version: 0.5.3
- Operating System: Linux (Ubuntu) x64
- Vscode Version: 1.47.3
I have a question about this. I have found that the return type is not specified inside the documentation when using type annotations. I found this in this examples for Google and Numpy styles. This would change the desired output to be:
def foo(bar: "int", buzz: int) -> "pd.DataFrame":
"""[summary]
Args:
bar: [description]
buzz: [description]
Returns:
[description]
"""
a = bar + buzz
return a
@NumberPiOso I followed the Google link and I can see returns in docstring when a return hint is present. Which to me looks like what should happen.
Or did I misunderstand your comment?