-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix useless-type-doc false positive when args exist in the docstring
- Loading branch information
1 parent
1ff8184
commit ce987fd
Showing
4 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""demonstrate FP with useless-type-doc""" | ||
# line-too-long | ||
|
||
|
||
def function(public_param: int, _some_private_param: bool = False) -> None: | ||
"""does things | ||
Args: | ||
public_param: an ordinary parameter | ||
""" | ||
for _ in range(public_param): | ||
... | ||
if _some_private_param: | ||
... | ||
else: | ||
... | ||
|
||
|
||
# +1: [useless-type-doc,useless-param-doc] | ||
def function_useless_doc(public_param: int, _some_private_param: bool = False) -> None: | ||
"""does things | ||
Args: | ||
public_param: an ordinary parameter | ||
_some_private_param (bool): private param | ||
""" | ||
for _ in range(public_param): | ||
... | ||
if _some_private_param: | ||
... | ||
else: | ||
... | ||
|
||
|
||
def test(_new: str) -> str: # We don't expect useless-type-doc here | ||
"""foobar | ||
:return: comment | ||
""" | ||
return "" | ||
|
||
|
||
# +1: [useless-type-doc,useless-param-doc] | ||
def test_two(_new: str) -> str: # We don't expect useless-type-doc here | ||
"""foobar | ||
:param str _new: | ||
:return: comment | ||
""" | ||
return "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[MASTER] | ||
load-plugins=pylint.extensions.docparams, | ||
|
||
[PARAMETER_DOCUMENTATION] | ||
accept-no-param-doc=no | ||
accept-no-raise-doc=no | ||
accept-no-return-doc=no | ||
accept-no-yields-doc=no |