mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
extracted augment assignment tests
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
exp = 2
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">value = value <caret>/ (10**exp) #comment</weak_warning>
|
||||
@@ -0,0 +1,2 @@
|
||||
exp = 2
|
||||
value /= 10 ** exp#comment
|
||||
@@ -0,0 +1,5 @@
|
||||
def retStr():
|
||||
return ''
|
||||
|
||||
s1 = ''
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">s1 = s1 <caret>+ retStr()</weak_warning>
|
||||
@@ -0,0 +1,5 @@
|
||||
def retStr():
|
||||
return ''
|
||||
|
||||
s1 = ''
|
||||
s1 += retStr()
|
||||
@@ -0,0 +1 @@
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">request = request + " FROM bugs WHERE bug_id = %s" % (str(bug_id))</weak_warning>
|
||||
@@ -0,0 +1 @@
|
||||
request += " FROM bugs WHERE bug_id = %s" % (str(bug_id))
|
||||
@@ -0,0 +1,3 @@
|
||||
v = 0
|
||||
f = 1
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">v = <caret>f + v</weak_warning>
|
||||
@@ -0,0 +1,3 @@
|
||||
v = 0
|
||||
f = 1
|
||||
v += f
|
||||
@@ -0,0 +1 @@
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">var = <caret>var + 3</weak_warning>
|
||||
@@ -0,0 +1 @@
|
||||
var += 3
|
||||
@@ -0,0 +1,3 @@
|
||||
current_sum = 1
|
||||
numbers = [1, 2, 3]
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">current_sum = current_sum + numbers[0]</weak_warning>
|
||||
@@ -0,0 +1,3 @@
|
||||
current_sum = 1
|
||||
numbers = [1, 2, 3]
|
||||
current_sum += numbers[0]
|
||||
@@ -0,0 +1,4 @@
|
||||
class A:
|
||||
x = 3
|
||||
a = A()
|
||||
<weak_warning descr="Assignment can be replaced with augmented assignment">a.x = a.x +<caret> 1</weak_warning>
|
||||
@@ -0,0 +1,4 @@
|
||||
class A:
|
||||
x = 3
|
||||
a = A()
|
||||
a.x += 1
|
||||
Reference in New Issue
Block a user