Skip to content

Commit 7deb297

Browse files
committed
Fix two!
1 parent 46bbed9 commit 7deb297

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pylint/extensions/_check_docs_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ def match_param_docs(self) -> tuple[set[str], set[str]]:
813813
# should be
814814
if param_type is None and re.match(r"\s*(\*{0,2}\w+)\s*:.+$", entry):
815815
param_type = param_desc
816+
# If the description is "" but we have a type description
817+
# we consider the description to be the type
818+
if not param_desc and param_type:
819+
param_desc = param_type
816820

817821
if param_type:
818822
params_with_type.add(param_name)

tests/functional/ext/docparams/parameter/missing_param_doc_required_Numpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,14 +409,15 @@ def test_with_list_of_default_values(arg, option, option2):
409409
return arg, option, option2
410410

411411

412-
def test_with_descriptions_instead_of_typing(arg, option):
412+
def test_with_descriptions_instead_of_typing(arg, axis, option):
413413
"""We choose to accept description in place of typing as well.
414414
415415
See: https://github.com/PyCQA/pylint/pull/7398.
416416
417417
Parameters
418418
----------
419419
arg : a number type.
420+
axis : int or None
420421
option : {"y", "n"}
421422
Do I do it?
422423
"""

0 commit comments

Comments
 (0)