Skip to content
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

[BUG] missing numpydoc parameters validation resulting in Nonetype exception #137

Closed
JoeHCQ1 opened this issue Mar 4, 2022 · 2 comments
Closed

Comments

@JoeHCQ1
Copy link
Contributor

JoeHCQ1 commented Mar 4, 2022

Describe the bug

Missing parameter description results in Nonetype error down the line instead of checking for that, warning the user, and passing a safe return for further use (safe is not None).

To Reproduce

(copied from comment on mkdocstrings/mkdocstrings#397)

"""
My numpydoc string documented function foo

Parameters
------------
param : str  # if I don't add a description below I get that None error
    Description to prevent Nonetype error.

Returns
--------
ret : str  # Interestingly if I omit elements of this I get specific warnings telling me what is wrong
    # I can also omit the description and get a pointed warning but no None error.
"""

Expected behavior

Code would display a warning or error noting that the parameter's description is missing similar to how it works in returns validation.

This: https://github.com/mkdocstrings/pytkdocs/blob/master/src/pytkdocs/parsers/docstrings/numpy.py#L104

Should have an added check like this: https://github.com/mkdocstrings/pytkdocs/blob/master/src/pytkdocs/parsers/docstrings/numpy.py#L196

System (please complete the following information):

  • pytkdocs version: 0.16.0
  • Python version: 3.8
  • OS: Ubuntu

Additional context

Discovered while trying to get to the bottom of mkdocstrings/mkdocstrings#397.

@JoeHCQ1
Copy link
Contributor Author

JoeHCQ1 commented Mar 4, 2022

I'll see if I can get a quick fix in for this - hopefully I can add this in easily and open a PR with the fix.

@JoeHCQ1
Copy link
Contributor Author

JoeHCQ1 commented Mar 4, 2022

See #138 where this is addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant