Skip to content

False positive missing-return-doc when a function is not supposed to be documented #4743

@finite-state-machine

Description

@finite-state-machine

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:

'''module docstring goes here'''

# this function doesn't require a docstring, because its name starts
# with an '_' (no-docstring-rgx):
def _function(some_arg: int) -> int:
    _ = some_arg
    return 0

rcfile:

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

[PARAMETER DOCUMENTATION]
accept-no-param-doc=no
accept-no-return-doc=no

Current behaviour

************* Module scrap
scrap.py:5:0: W9011: Missing return documentation (missing-return-doc)

------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00)

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:

pylint 3.0.0-a4
astroid 2.6.5
Python 3.8.3 (default, Jul  6 2020, 09:12:34)
[Clang 10.0.1 (clang-1001.0.46.4)]

Metadata

Metadata

Labels

Blocker 🙅Blocks the next releaseFalse Positive 🦟A message is emitted but nothing is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationRegression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions