Skip to content

Commit 4827cfa

Browse files
Add more docs for messages (#7912)
* add docs for useless-param-doc * add docs for useless-type-doc * add docs for useless-with-lock * add docs for eq-without-hash Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent 528891c commit 4827cfa

File tree

15 files changed

+62
-8
lines changed

15 files changed

+62
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Fruit: # [eq-without-hash]
2+
def __init__(self) -> None:
3+
self.name = "apple"
4+
5+
def __eq__(self, other: object) -> bool:
6+
return isinstance(other, Fruit) and other.name == self.name

doc/data/messages/e/eq-without-hash/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# This is a placeholder for correct code for this message.
1+
class Fruit:
2+
def __init__(self) -> None:
3+
self.name = "apple"
4+
5+
def __eq__(self, other: object) -> bool:
6+
return isinstance(other, Fruit) and other.name == self.name
7+
8+
def __hash__(self) -> int:
9+
return hash(self.name)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[MAIN]
2+
load-plugins=pylint.extensions.eq_without_hash,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def say_hello(_new: str) -> str: # [useless-param-doc]
2+
"""say hello!
3+
4+
:param _new:
5+
:return: comment
6+
"""
7+
return "hello"

doc/data/messages/u/useless-param-doc/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
# This is a placeholder for correct code for this message.
1+
def say_hello(_new: str) -> str:
2+
"""say hello!
3+
4+
:return: comment
5+
"""
6+
return "hello"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[MAIN]
2+
load-plugins=pylint.extensions.docparams,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def print_fruit(fruit, _): # [useless-type-doc]
2+
"""docstring ...
3+
4+
Args:
5+
fruit (str): A fruit.
6+
_ (float): Another argument.
7+
"""
8+
print(fruit)

doc/data/messages/u/useless-type-doc/details.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)