Skip to content

False negative: missing numpy param doc when "default ..." in same line of "param : type" #6211

@vepain

Description

@vepain

Bug description

False negative :
Warning "missing param doc" should'nt be raised when these type of docstring format:

def func(x: int = 0):
  """This is func.

  Parameter
  ---------
  x : int, default 0  # this raises the warning
    The x parameter
  """
  # ...

Configuration

[MASTER]
load-plugins =
    pylint.extensions.docstyle,
    pylint.extensions.docparams

[MESSAGES CONTROL]
enable = W

[BASIC]
accept-no-param-doc = no

Command used

pylint --rcfile=tox.ini a.py

Pylint output

"orientation" missing in parameter documentation

Expected behavior

No warning

In fact, numpy style doc says:

These are all equivalent:

copy : bool, default True
copy : bool, default=True
copy : bool, default: True

Pylint version

pylint 2.13.5
astroid 2.11.2
Python 3.9.12 (main, Mar 24 2022, 16:20:11) 
[GCC 9.4.0]

OS / Environment

Ubuntu 20.04

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions