Skip to content

Commit 3cc7e7f

Browse files
committed
add too-few-function-args to docs
1 parent 9682d47 commit 3cc7e7f

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Fruit:
2+
def __init__(self, color, name):
3+
self.color = color
4+
self.name = name
5+
6+
7+
apple = Fruit("red") # [too-few-function-args]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Fruit:
2+
def __init__(self, color, name):
3+
self.color = color
4+
self.name = name
5+
6+
7+
apple = Fruit("red", "apple")

pylint/checkers/typecheck.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _missing_member_hint(
255255
"Used when a function call passes too few arguments.",
256256
),
257257
"E1121": (
258-
"Too many positional arguments (%s/%s)",
258+
"Too many positional arguments for function `%s` (%s/%s)",
259259
"too-many-function-args",
260260
"Used when a function call passes too many positional arguments.",
261261
),
@@ -378,7 +378,7 @@ def _missing_member_hint(
378378
"a custom __getitem__ method.",
379379
),
380380
"E1145": (
381-
"Too few positional arguments (%s/%s)",
381+
"Too few positional arguments for function `%s` (%s/%s)",
382382
"too-few-function-args",
383383
"Used when a function or method has fewer arguments than expected.",
384384
),
@@ -1430,14 +1430,14 @@ def _check_isinstance_args(self, node: nodes.Call) -> None:
14301430
self.add_message(
14311431
"too-many-function-args",
14321432
node=node,
1433-
args=(len(node.args), 2),
1433+
args=("isinstance", len(node.args), 2),
14341434
confidence=HIGH,
14351435
)
14361436
elif len(node.args) < 2:
14371437
self.add_message(
14381438
"too-few-function-args",
14391439
node=node,
1440-
args=(len(node.args), 2),
1440+
args=("isinstance", len(node.args), 2),
14411441
confidence=HIGH,
14421442
)
14431443
return
@@ -1574,7 +1574,7 @@ def visit_call(self, node: nodes.Call) -> None:
15741574
self.add_message(
15751575
"too-many-function-args",
15761576
node=node,
1577-
args=(len(parameters), num_positional_args),
1577+
args=(callable_name, len(parameters), num_positional_args),
15781578
)
15791579
break
15801580

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
too-few-function-args:3:0:3:13::Too few positional arguments (1/2):HIGH
1+
too-few-function-args:3:0:3:13::Too few positional arguments for function `isinstance` (1/2):HIGH
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
too-many-function-args:23:0:23:23::Too many positional arguments (3/2):HIGH
1+
too-many-function-args:23:0:23:23::Too many positional arguments for function `isinstance` (3/2):HIGH
22
isinstance-second-argument-not-valid-type:24:0:24:21::Second argument of isinstance is not a type:INFERENCE
3-
too-many-function-args:24:0:24:21::Too many positional arguments (3/2):HIGH
3+
too-many-function-args:24:0:24:21::Too many positional arguments for function `isinstance` (3/2):HIGH

0 commit comments

Comments
 (0)