-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
False negative: missing numpy param doc when "default ..." in same line of "param : type" #6211
Comments
+1 having the same issue. Just to add - the following does not raise any error, so maybe just allow items in parenthesis and/or the "default" word after the comma? def func(x: int = 0):
"""This is func.
Parameter
---------
x : int, optional
The x parameter, by default 0
"""
# ... |
See https://numpydoc.readthedocs.io/en/latest/format.html#parameters and the failures in #7149. |
I am seeing this as well with
using
@DanielNoord Has this not been fixed yet? |
No, I don't think so. The linked PR fixed something different. |
@DanielNoord Can you point me to the section of code to review? I can submit a PR if you like. |
Actually, I'm assuming this is pylint/extensions/docparams.py. I'll submit a PR. |
That's right @adam-grant-hendry, most tests for this checker are in https://github.com/PyCQA/pylint/tree/main/tests/functional/ext/docparams |
NumPy doc style guide permits using `default` in parameter signatures. Fixes: pylint-dev#6211
NumPy doc style guide permits using `default` in parameter signatures. Fixes: pylint-dev#6211
Fix was for issue pylint-dev#6211. The PR that fixes this is pylint-dev#7360. See pylint-dev#6211
NumPy doc style guide permits using `default` in parameter signatures. Fixes: pylint-dev#6211
Fix was for issue pylint-dev#6211. The PR that fixes this is pylint-dev#7360. See pylint-dev#6211
@lkev @vepain One note: you are using re_param_section = re.compile(
_re_section_template.format(r"(?:Args|Arguments|Parameters)"),
re.X | re.S | re.M,
) and this is how it is written in the Note, this doesn't fix the bug, but wanted to point it out because you will silently think everything is fine when it is not. |
NumPy doc style guide permits using `default` in parameter signatures. Fixes: pylint-dev#6211
Fix was for issue pylint-dev#6211. The PR that fixes this is pylint-dev#7360. See pylint-dev#6211
Bug description
False negative :
Warning "missing param doc" should'nt be raised when these type of docstring format:
Configuration
Command used
Pylint output
Expected behavior
No warning
In fact, numpy style doc says:
Pylint version
OS / Environment
Ubuntu 20.04
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: