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

False positive differing-param-doc if positional-only #6950

Closed
spagh-eddie opened this issue Jun 14, 2022 · 1 comment · Fixed by #6980
Closed

False positive differing-param-doc if positional-only #6950

spagh-eddie opened this issue Jun 14, 2022 · 1 comment · Fixed by #6980
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Milestone

Comments

@spagh-eddie
Copy link
Contributor

spagh-eddie commented Jun 14, 2022

Bug description

I have a docparam for bar, but pylint complains.
If I make bar not positional-only and remove , / from function definition, pylint does not complain.

# pylint: disable=missing-module-docstring,disallowed-name
def foo(bar: int, /):
    """Foo a bar

    :param bar: not spam
    """
    return bar + 1

I did a bit of digging myself and saw that bar was not included in this arguments_node.args, but it is included in arguments_node.arguments. I am not familiar enough with these to say anything like "it should be .arguments instead of .args."

Configuration

# pyproject.toml
[tool.pylint.master]
load-plugins = [
    "pylint.extensions.docparams",
    "pylint.extensions.docstyle",
]

Command used

pylint --score no test.py

Pylint output

************* Module test
test.py:2:0: W9017: "bar" differing in parameter documentation (differing-param-doc)

Expected behavior

expect no output, same as if remove , /

Pylint version

pylint 2.14.1
astroid 2.11.5
Python 3.10.1 (main, Jan 12 2022, 15:59:59) [Clang 13.0.0 (clang-1300.0.27.3)]

OS / Environment

macOS 12.0.1 (21A559)

Additional dependencies

No response

@spagh-eddie spagh-eddie added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jun 14, 2022
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jun 14, 2022
@mpernigo
Copy link
Contributor

I have done some digging, too.
I think posonly could be handled similar to how kwonly are (docparams.py#L527, docparams.py#L542-L544).

I could open a PR for this - unless anybody already started working on it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants