Skip to content

Commit 95818cb

Browse files
committed
Revert "Increase the default value for maximum number of function parameters from 5 to 7."
This reverts commit 5a6e5bb.
1 parent fb08599 commit 95818cb

File tree

7 files changed

+9
-12
lines changed

7 files changed

+9
-12
lines changed

pylint/checkers/design_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class MisdesignChecker(BaseChecker):
285285
(
286286
"max-args",
287287
{
288-
"default": 7,
288+
"default": 5,
289289
"type": "int",
290290
"metavar": "<int>",
291291
"help": "Maximum number of arguments for function / method.",

tests/functional/a/async_functions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
redefined-builtin:5:0:5:14:next:Redefining built-in 'next':UNDEFINED
22
unused-argument:8:30:8:34:some_function:Unused argument 'arg2':HIGH
33
bad-super-call:22:8:22:31:Class.some_method:Bad first argument 'OtherClass' given to super():UNDEFINED
4-
too-many-arguments:26:0:26:26:complex_function:Too many arguments (10/7):UNDEFINED
4+
too-many-arguments:26:0:26:26:complex_function:Too many arguments (10/5):UNDEFINED
55
too-many-branches:26:0:26:26:complex_function:Too many branches (13/12):UNDEFINED
66
too-many-return-statements:26:0:26:26:complex_function:Too many return statements (10/6):UNDEFINED
77
dangerous-default-value:57:0:57:14:func:Dangerous default value [] as argument:UNDEFINED

tests/functional/t/too/too_many_arguments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ def func_call():
3333

3434

3535
# +1: [too-many-arguments]
36-
def name1(par1, par2, par3, par4, par5, /, par6, par7, *args, par8="apple", **kwargs):
37-
return par1, par2, par3, par4, par5, par6, par7, par8, args, kwargs
36+
def name1(param1, param2, param3, /, param4, param5, *args, param6="apple", **kwargs):
37+
return param1, param2, param3, param4, param5, param6, args, kwargs
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/7):UNDEFINED
2-
too-many-arguments:36:0:36:9:name1:Too many arguments (8/7):UNDEFINED
1+
too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/5):UNDEFINED
2+
too-many-arguments:36:0:36:9:name1:Too many arguments (6/5):UNDEFINED

tests/functional/t/too/too_many_locals.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,13 @@ def too_many_locals_function(): # [too-many-locals]
2929
args15 = args14 * 15
3030
return args15
3131

32-
# +1: [too-many-arguments]
33-
def too_many_arguments_function(arga, argu, argi, arge, argt, args, arg7, arg8):
32+
def too_many_arguments_function(arga, argu, argi, arge, argt, args): # [too-many-arguments]
3433
"""pylint will complain about too many arguments."""
3534
arga = argu
3635
arga += argi
3736
arga += arge
3837
arga += argt
3938
arga += args
40-
arga += arg7
41-
arga += arg8
4239
return arga
4340

4441
def ignored_arguments_function(arga, argu, argi,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
too-many-locals:4:0:4:12:function:Too many local variables (16/15):UNDEFINED
22
too-many-locals:12:0:12:28:too_many_locals_function:Too many local variables (16/15):UNDEFINED
3-
too-many-arguments:33:0:33:31:too_many_arguments_function:Too many arguments (8/7):UNDEFINED
3+
too-many-arguments:32:0:32:31:too_many_arguments_function:Too many arguments (6/5):UNDEFINED

tests/functional/u/unexpected_special_method_signature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Test for special methods implemented incorrectly."""
22

33
# pylint: disable=missing-docstring, unused-argument, too-few-public-methods
4-
# pylint: disable=invalid-name,bad-staticmethod-argument
4+
# pylint: disable=invalid-name,too-many-arguments,bad-staticmethod-argument
55

66
class Invalid:
77

0 commit comments

Comments
 (0)