pylint
pylint copied to clipboard
`@overload` causes `missing-param-doc` despite parameter being documented
Bug description
Analyzing the following code with pylint, using the given rcfile, results in an unexpected missing-param-doc
error:
'''module docstring
'''
from __future__ import annotations
from typing import (
Iterable,
Optional,
overload,
)
# pylint: disable-next=too-few-public-methods
class SomeClass:
'''this docstring must be present
'''
@overload
def __init__(self, _iterable: Iterable[object], /) -> None: ...
@overload
def __init__(self, /) -> None: ...
def __init__(
self, _iterable: Optional[Iterable[object]] = None, /
):
'''constructor
Args:
_iterable: if specified, this must be an iterable of
elements which will become the initial contents of this
set
'''
_ = _iterable
Configuration
[MAIN]
load-plugins=pylint.extensions.docparams
[BASIC]
no-docstring-rgx=^(__(?!(init|new|call)__)\w+__|test_|mypy_|some_function)
[PARAMETER_DOCUMENTATION]
accept-no-param-doc=no
default-docstring-type=google
[VARIABLES]
ignored-argument-names=^ignored_|^unused_
Command used
python3 -m pylint --rcfile=pylintrc-bug bug.py
Pylint output
************* Module bug
bug.py:12:0: W9015: "_iterable" missing in parameter documentation (missing-param-doc)
------------------------------------------------------------------
Your code has been rated at 8.89/10 (previous run: 8.89/10, +0.00)
Expected behavior
Since _iterable
is clearly documented in the google
style, there should be no missing-param-doc
error.
Pylint version
pylint 3.2.3
astroid 3.2.2
Python 3.8.16 (default, Mar 24 2023, 14:42:29)
[Clang 14.0.0 (clang-1400.0.29.202)]
OS / Environment
macOS 14
Additional dependencies
No response
Attachments
This zip contains bug.py
and pylintrc-bug
.