-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 positive missing-return-doc
when a function is not supposed to be documented
#4743
Comments
In case it's helpful to mention them, the author and reviewers of the pull request relating to #2738 are: @komodo472, @Pierre-Sassoulas, and @hippo91. |
missing-return-doc
when a function is not supposed to be documented
I was looking into this, and I think I found the issue. In the docparams extension, the if not isinstance(func_node, astroid.FunctionDef):
return Something along the lines of # skip functions that match the 'no-docstring-rgx' config option
no_docstring_rgx = self.linter.config.no_docstring_rgx
if no_docstring_rgx and re.match(no_docstring_rgx, func_node.name):
return I can put together a PR for this. But if I'm doing it, I'd first like to understand why there's both |
Sorry for the delay @mwchase. This is indeed strange, it seems that the checks could be duplicated, in particular and recovering the return nodes of a single function is better than recovering the function def node of all return function then recovering their docstrings. And we'd need to do it several time for other nodes too if it wasn't done in Just a supposition, I did not run actual performance comparison. Do you want to investigate ? Docparam is very well tested, I would not be afraid to refactor it. But at least a little explanation added in the code as a comment would not hurt. |
Ah, I guess I should file a followup issue for |
Oh I completely misread your comment and looked over the I can probably write a PR for this somewhere this afternoon. @Pierre-Sassoulas I'm reopening this issue and adding the blocker label. I think it makes sense to fix these three issues in the same patch release. Review shouldn't be too difficult now that we have done #7410. Edit: PR at #7421. |
Issue #2738 appears to persist on pylint 2.9.5 as well as 3.0.0-a4 (as retrieved using
pip install --upgrade [--pre] pylint
on this date). The merge request for that issue seems to imply this fix should have gone out with pylint 2.7.x.Has something gone wrong here, or have I misunderstood the merge?
Steps to reproduce
File to be analyzed:
rcfile:
Current behaviour
Expected behavior
There should be no errors;
_function
requires no docstring and should therefore require no return documentation.pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: