Skip to content

Commit

Permalink
Handle asterisks better in Sphinx and Google style docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored and Sam M W committed Apr 29, 2022
1 parent 2886193 commit 52ebeb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ Release date: 2022-04-20

Closes #6301


What's New in Pylint 2.13.5?
============================
Release date: 2022-04-06
Expand Down
16 changes: 8 additions & 8 deletions pylint/extensions/docparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from __future__ import annotations

import re
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Optional, Set

import astroid
from astroid import nodes
Expand Down Expand Up @@ -365,10 +365,10 @@ def visit_yieldfrom(self, node: nodes.YieldFrom) -> None:

def _compare_missing_args(
self,
found_argument_names: set[str],
found_argument_names: Set[str],
message_id: str,
not_needed_names: set[str],
expected_argument_names: set[str],
not_needed_names: Set[str],
expected_argument_names: Set[str],
warning_node: nodes.NodeNG,
) -> None:
"""Compare the found argument names with the expected ones and
Expand Down Expand Up @@ -404,10 +404,10 @@ def _compare_missing_args(

def _compare_different_args(
self,
found_argument_names: set[str],
found_argument_names: Set[str],
message_id: str,
not_needed_names: set[str],
expected_argument_names: set[str],
not_needed_names: Set[str],
expected_argument_names: Set[str],
warning_node: nodes.NodeNG,
) -> None:
"""Compare the found argument names with the expected ones and
Expand All @@ -424,7 +424,7 @@ def _compare_different_args(
:param warning_node: The node to be analyzed
"""
# Handle variadic and keyword args without asterisks
modified_expected_argument_names: set[str] = set()
modified_expected_argument_names: Set[str] = set()
for name in expected_argument_names:
if name.replace("*", "") in found_argument_names:
modified_expected_argument_names.add(name.replace("*", ""))
Expand Down

0 comments on commit 52ebeb3

Please sign in to comment.