Commit f0bd74b
The PR add the `fix safety` section for rule `SIM210` (astral-sh#15584 )
It is a little cheating, as the Fix safety section is copy/pasted by
astral-sh#18086 as the problem is the same.
### Unsafe Fix Example
```python
class Foo():
def __eq__(self, other):
return 0
def foo():
return True if Foo() == 0 else False
def foo_fix():
return Foo() == 0
print(foo()) # False
print(foo_fix()) # 0
```
1 parent 13d1e33 commit f0bd74b
File tree
1 file changed
+7
-0
lines changed- crates/ruff_linter/src/rules/flake8_simplify/rules
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| |||
0 commit comments