You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/ruff_linter/src/rules/flake8_simplify/snapshots/ruff_linter__rules__flake8_simplify__tests__SIM108_SIM108.py.snap
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ SIM108.py:117:1: SIM108 Use ternary operator `x = 3 if True else 5` instead of `
118
118
|
119
119
=help: Replace`if`-`else`-blockwith`x = 3 if True else 5`
120
120
121
-
SIM108.py:141:1: SIM108 [*] Useternaryoperator`z = cond if cond else other_cond`insteadof`if`-`else`-block
121
+
SIM108.py:141:1: SIM108 [*] Usebinaryoperator`z = cond or other_cond`insteadof`if`-`else`-block
122
122
|
123
123
139| # SIM108-shouldsuggest
124
124
140| # z=condorother_cond
@@ -130,7 +130,7 @@ SIM108.py:141:1: SIM108 [*] Use ternary operator `z = cond if cond else other_co
130
130
145|
131
131
146| # SIM108-shouldsuggest
132
132
|
133
-
=help: Replace`if`-`else`-blockwith`z = cond if cond else other_cond`
133
+
=help: Replace`if`-`else`-blockwith`z = cond or other_cond`
134
134
135
135
ℹ Unsafefix
136
136
138138|
@@ -140,12 +140,12 @@ SIM108.py:141:1: SIM108 [*] Use ternary operator `z = cond if cond else other_co
140
140
142|-z=cond
141
141
143|-else:
142
142
144|-z=other_cond
143
-
141|+z=condifcondelseother_cond
143
+
141|+z=condorother_cond
144
144
145142|
145
145
146143| # SIM108-shouldsuggest
146
146
147144| # z=condandother_cond
147
147
148
-
SIM108.py:148:1: SIM108 [*] Useternaryoperator`z = cond if not cond else other_cond`insteadof`if`-`else`-block
148
+
SIM108.py:148:1: SIM108 [*] Usebinaryoperator`z = cond and other_cond`insteadof`if`-`else`-block
149
149
|
150
150
146| # SIM108-shouldsuggest
151
151
147| # z=condandother_cond
@@ -157,7 +157,7 @@ SIM108.py:148:1: SIM108 [*] Use ternary operator `z = cond if not cond else othe
157
157
152|
158
158
153| # SIM108-shouldsuggest
159
159
|
160
-
=help: Replace`if`-`else`-blockwith`z = cond if not cond else other_cond`
160
+
=help: Replace`if`-`else`-blockwith`z = cond and other_cond`
161
161
162
162
ℹ Unsafefix
163
163
145145|
@@ -167,12 +167,12 @@ SIM108.py:148:1: SIM108 [*] Use ternary operator `z = cond if not cond else othe
167
167
149|-z=cond
168
168
150|-else:
169
169
151|-z=other_cond
170
-
148|+z=condifnotcondelseother_cond
170
+
148|+z=condandother_cond
171
171
152149|
172
172
153150| # SIM108-shouldsuggest
173
173
154151| # z=notcondandother_cond
174
174
175
-
SIM108.py:155:1: SIM108 [*] Useternaryoperator`z = not cond if cond else other_cond`insteadof`if`-`else`-block
175
+
SIM108.py:155:1: SIM108 [*] Usebinaryoperator`z = not cond and other_cond`insteadof`if`-`else`-block
176
176
|
177
177
153| # SIM108-shouldsuggest
178
178
154| # z=notcondandother_cond
@@ -184,7 +184,7 @@ SIM108.py:155:1: SIM108 [*] Use ternary operator `z = not cond if cond else othe
184
184
159|
185
185
160| # SIM108doesnotsuggest
186
186
|
187
-
=help: Replace`if`-`else`-blockwith`z = not cond if cond else other_cond`
187
+
=help: Replace`if`-`else`-blockwith`z = not cond and other_cond`
188
188
189
189
ℹ Unsafefix
190
190
152152|
@@ -194,7 +194,7 @@ SIM108.py:155:1: SIM108 [*] Use ternary operator `z = not cond if cond else othe
0 commit comments