Skip to content

Commit

Permalink
Create new error arguments-renamed
Browse files Browse the repository at this point in the history
This commits creates the new error arguments-renamed based on the functionality
added on pylint-dev#4422 and the changes of pylint-dev#4456.
  • Loading branch information
ksaketou committed May 11, 2021
1 parent 6b3c498 commit c5c5324
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pylint/checkers/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ def _different_parameters(
output_messages.append("Number of parameters ")
output_messages += different_positional[1:]
output_messages += different_kwonly[1:]
else:
output_messages += different_positional
output_messages += different_kwonly
else:
if different_positional:
output_messages += different_positional
Expand Down Expand Up @@ -627,6 +630,12 @@ def _has_same_layout_slots(slots, assigned_value):
"that does not match its base class "
"which could result in potential bugs at runtime.",
),
"W0237": (
"%s %s %r method",
"arguments-renamed",
"Used when a method parameter has a different name than in "
"the implemented interface or in an overridden method.",
),
"E0236": (
"Invalid object %r in __slots__, must contain only non empty strings",
"invalid-slots-object",
Expand Down Expand Up @@ -1821,6 +1830,16 @@ def _check_signature(self, method1, refmethod, class_type, cls):
),
node=method1,
)
elif "renamed" in msg:
self.add_message(
"arguments-renamed",
args=(
msg,
class_type,
str(method1.parent.name) + "." + str(method1.name),
),
node=method1,
)
else:
self.add_message(
"arguments-differ",
Expand Down

0 comments on commit c5c5324

Please sign in to comment.