-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add Python setting to not include type annotations in docstrings #97
Comments
I did fix it, but I simply removed the type from the generated docblock because Google never defined this. I have zero clue why I added this, but it's fixed. |
This bug has been fixed and released in v3.0.1. Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution. |
I can make a separate issue if necessary, but I'd love to have types omitted from the params section of the docstring if annotations are in the function signature for numpy style The Sphinx documentation shows the following examples for numpy-style docstrings: def function_with_types_in_docstring(param1, param2):
"""Example function with types documented in the docstring.
`PEP 484`_ type annotations are supported. If attribute, parameter, and
return types are annotated according to `PEP 484`_, they do not need to be
included in the docstring:
Parameters
----------
param1 : int
The first parameter.
param2 : str
The second parameter.
Returns
-------
bool
True if successful, False otherwise.
.. _PEP 484:
https://www.python.org/dev/peps/pep-0484/
"""
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
"""Example function with PEP 484 type annotations.
The return type must be duplicated in the docstring to comply
with the NumPy docstring style.
Parameters
----------
param1
The first parameter.
param2
The second parameter.
Returns
-------
bool
True if successful, False otherwise.
""" However, currently Doge includes types in the Parameters section regardless of whether type annotations are present. |
@daturkel Please make a new issue and I'll look at it later. |
Take, for example, this function:
This is the generated Google-style docstring:
It would be nice to have the option to generate this instead:
The text was updated successfully, but these errors were encountered: