Skip to content

Commit 55089d8

Browse files
committed
Prepare too-many-positional-arguments test for static and class methods
1 parent a1583e5 commit 55089d8

2 files changed

Lines changed: 15 additions & 10 deletions

File tree

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# pylint: disable=missing-function-docstring, missing-module-docstring
2-
class SixArgumentMethods:
3-
"""The max positional arguments default is 5, so 6 for a method because of self."""
4-
def fail1(self, a, b, c, d, e, f): # [too-many-arguments, too-many-positional-arguments]
2+
class RegularMethods:
3+
"""The max positional arguments default is 5. Regular methods doesn't count `self`."""
4+
# +1: [too-many-arguments, too-many-positional-arguments]
5+
def regular_fail1(self, a, b, c, d, e, f):
56
pass
6-
def fail2(self, a, b, c, d, e, /, f): # [too-many-arguments, too-many-positional-arguments]
7+
# +1: [too-many-arguments, too-many-positional-arguments]
8+
def regular_fail2(self, a, b, c, d, e, /, f):
79
pass
8-
def okay1(self, a, b, c, d, e, *, f=True): # [too-many-arguments]
10+
# +1: [too-many-arguments]
11+
def regular_okay1(self, a, b, c, d, e, *, f=True):
12+
pass
13+
def regular_okay2(self, a, b, c, d, e):
914
pass
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
too-many-arguments:4:4:4:13:SixArgumentMethods.fail1:Too many arguments (7/6):UNDEFINED
2-
too-many-positional-arguments:4:4:4:13:SixArgumentMethods.fail1:Too many positional arguments (7/6):HIGH
3-
too-many-arguments:6:4:6:13:SixArgumentMethods.fail2:Too many arguments (7/6):UNDEFINED
4-
too-many-positional-arguments:6:4:6:13:SixArgumentMethods.fail2:Too many positional arguments (7/6):HIGH
5-
too-many-arguments:8:4:8:13:SixArgumentMethods.okay1:Too many arguments (7/6):UNDEFINED
1+
too-many-arguments:5:4:5:21:RegularMethods.regular_fail1:Too many arguments (7/6):UNDEFINED
2+
too-many-positional-arguments:5:4:5:21:RegularMethods.regular_fail1:Too many positional arguments (7/6):HIGH
3+
too-many-arguments:8:4:8:21:RegularMethods.regular_fail2:Too many arguments (7/6):UNDEFINED
4+
too-many-positional-arguments:8:4:8:21:RegularMethods.regular_fail2:Too many positional arguments (7/6):HIGH
5+
too-many-arguments:11:4:11:21:RegularMethods.regular_okay1:Too many arguments (7/6):UNDEFINED

0 commit comments

Comments
 (0)