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

docparams should support missing type documentation when type comments are used #6287

Closed
AWhetter opened this issue Apr 13, 2022 · 0 comments · Fixed by #6288 or #9093
Closed

docparams should support missing type documentation when type comments are used #6287

AWhetter opened this issue Apr 13, 2022 · 0 comments · Fixed by #6288 or #9093
Assignees
Labels
Enhancement ✨ Improvement to a component
Milestone

Comments

@AWhetter
Copy link
Contributor

Current problem

When running pylint (pylint --disable=all --enable=missing-type-doc --load-plugins=pylint.extensions.docparams code.py) with the following code, no errors are displayed:

def variant(node: str) -> list[str]:
    """Get the variants for the given `node`.

    Args:
        node: The node to get the variants for.

    Returns:
        The available variants.

    """
    return ["hi"]

However when type comments are used, a missing-type-doc warning is shown:

def variant(node):
    # type: (str) -> list[str]
    """Get the variants for the given `node`.

    Args:
        node: The node to get the variants for.

    Returns:
        The available variants.

    """
    return ["hi"]

Desired solution

Ideally docparams would allow type comments to count as type documentation, just like regular type annotations are allowed.
This will require changes on these lines: https://github.com/PyCQA/pylint/blob/a6cb836da56b051cdc0d584d726fb7579415cb54/pylint/extensions/docparams.py#L560-L563

Additional context

No response

@AWhetter AWhetter added the Enhancement ✨ Improvement to a component label Apr 13, 2022
@AWhetter AWhetter self-assigned this Apr 13, 2022
AWhetter added a commit to AWhetter/pylint that referenced this issue Apr 13, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.14.0 milestone Apr 13, 2022
@DanielNoord DanielNoord removed this from the 2.14.0 milestone May 4, 2022
AWhetter added a commit to AWhetter/pylint that referenced this issue Oct 14, 2022
AWhetter added a commit to AWhetter/pylint that referenced this issue Oct 14, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Oct 15, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.16.0, 2.17.0 Jan 8, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.17.0, 3.0.0 Mar 7, 2023
Pierre-Sassoulas added a commit to AWhetter/pylint that referenced this issue May 16, 2023
Closes pylint-dev#6287

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0, 3.0.0a7 May 16, 2023
Pierre-Sassoulas added a commit to AWhetter/pylint that referenced this issue May 21, 2023
Closes pylint-dev#6287

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Pierre-Sassoulas added a commit to AWhetter/pylint that referenced this issue May 22, 2023
Closes pylint-dev#6287

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
AWhetter added a commit to AWhetter/pylint that referenced this issue May 31, 2023
AWhetter added a commit to AWhetter/pylint that referenced this issue Jun 13, 2023
AWhetter added a commit to AWhetter/pylint that referenced this issue Jun 13, 2023
Pierre-Sassoulas added a commit that referenced this issue Jun 13, 2023
…6288)

Closes #6287

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
3 participants