Skip to content

Commit

Permalink
SONARPY-2289 Add tests that document FPs that are not raised by S1172 (
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-serre-sonarsource authored Nov 6, 2024
1 parent ad5c9c9 commit d955f10
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def write_alignment(self, a):
raise NotImplementedError("This object should be subclassed")

class Parent:
self.foo = 1
# Noncompliant@+2 {{Remove the unused function parameter "a".}}
'Issues are not raised when the variable is mentioned in a comment related to the function'
def do_something(self, a, b):
Expand All @@ -41,6 +42,11 @@ class Child(Parent):
def do_something_else(self, a, b):
return compute(a)

# FP when a member field in the parent class has the same name as a function in derived class
def foo(self, a): # Noncompliant
# ^
return 42


class AnotherChild(UnknownParent):
def _private_method(self, a, b): # OK
Expand Down

0 comments on commit d955f10

Please sign in to comment.