Skip to content

Commit

Permalink
Increase the default value for maximum number of function parameters …
Browse files Browse the repository at this point in the history
…from 5 to 7.
  • Loading branch information
mbyrnepr2 committed May 11, 2023
1 parent 0056721 commit 5a6e5bb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pylint/checkers/design_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 285,7 @@ class MisdesignChecker(BaseChecker):
(
"max-args",
{
"default": 5,
"default": 7,
"type": "int",
"metavar": "<int>",
"help": "Maximum number of arguments for function / method.",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/a/async_functions.txt
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
redefined-builtin:5:0:5:14:next:Redefining built-in 'next':UNDEFINED
unused-argument:8:30:8:34:some_function:Unused argument 'arg2':HIGH
bad-super-call:22:8:22:31:Class.some_method:Bad first argument 'OtherClass' given to super():UNDEFINED
too-many-arguments:26:0:26:26:complex_function:Too many arguments (10/5):UNDEFINED
too-many-arguments:26:0:26:26:complex_function:Too many arguments (10/7):UNDEFINED
too-many-branches:26:0:26:26:complex_function:Too many branches (13/12):UNDEFINED
too-many-return-statements:26:0:26:26:complex_function:Too many return statements (10/6):UNDEFINED
dangerous-default-value:57:0:57:14:func:Dangerous default value [] as argument:UNDEFINED
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/t/too/too_many_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 33,5 @@ def func_call():


# 1: [too-many-arguments]
def name1(param1, param2, param3, /, param4, param5, *args, param6="apple", **kwargs):
return param1, param2, param3, param4, param5, param6, args, kwargs
def name1(par1, par2, par3, par4, par5, /, par6, par7, *args, par8="apple", **kwargs):
return par1, par2, par3, par4, par5, par6, par7, par8, args, kwargs
4 changes: 2 additions & 2 deletions tests/functional/t/too/too_many_arguments.txt
Original file line number Diff line number Diff line change
@@ -1,2 1,2 @@
too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/5):UNDEFINED
too-many-arguments:36:0:36:9:name1:Too many arguments (6/5):UNDEFINED
too-many-arguments:3:0:3:19:stupid_function:Too many arguments (9/7):UNDEFINED
too-many-arguments:36:0:36:9:name1:Too many arguments (8/7):UNDEFINED
5 changes: 4 additions & 1 deletion tests/functional/t/too/too_many_locals.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 29,16 @@ def too_many_locals_function(): # [too-many-locals]
args15 = args14 * 15
return args15

def too_many_arguments_function(arga, argu, argi, arge, argt, args): # [too-many-arguments]
# 1: [too-many-arguments]
def too_many_arguments_function(arga, argu, argi, arge, argt, args, arg7, arg8):
"""pylint will complain about too many arguments."""
arga = argu
arga = argi
arga = arge
arga = argt
arga = args
arga = arg7
arga = arg8
return arga

def ignored_arguments_function(arga, argu, argi,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/t/too/too_many_locals.txt
Original file line number Diff line number Diff line change
@@ -1,3 1,3 @@
too-many-locals:4:0:4:12:function:Too many local variables (16/15):UNDEFINED
too-many-locals:12:0:12:28:too_many_locals_function:Too many local variables (16/15):UNDEFINED
too-many-arguments:32:0:32:31:too_many_arguments_function:Too many arguments (6/5):UNDEFINED
too-many-arguments:33:0:33:31:too_many_arguments_function:Too many arguments (8/7):UNDEFINED
2 changes: 1 addition & 1 deletion tests/functional/u/unexpected_special_method_signature.py
Original file line number Diff line number Diff line change
@@ -1,7 1,7 @@
"""Test for special methods implemented incorrectly."""

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

class Invalid:

Expand Down

0 comments on commit 5a6e5bb

Please sign in to comment.