Skip to content

Commit f1d0d9a

Browse files
committed
Format fixture
1 parent 5a8e1c0 commit f1d0d9a

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

crates/ruff_linter/resources/test/fixtures/pylint/modified_iterating_set.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Positive cases
1+
# Errors
22

33
nums = {1, 2, 3}
44
for num in nums:
@@ -20,7 +20,7 @@
2020
for color in colors:
2121
colors.remove("red")
2222

23-
# Negative cases
23+
# OK
2424

2525
nums = {1, 2, 3}
2626
for num in nums.copy():
@@ -38,13 +38,18 @@
3838
temp_fruits.clear(fruit)
3939

4040
colors = {"red", "green", "blue"}
41+
42+
4143
def add_colors():
4244
colors = {"cyan", "magenta", "yellow"}
4345
for color in colors:
46+
4447
def add_color():
4548
global colors
4649
colors.add(color)
50+
4751
add_color()
4852

53+
4954
add_colors()
50-
print(colors)
55+
print(colors)

crates/ruff_linter/src/rules/pylint/snapshots/ruff_linter__rules__pylint__tests__PLE4703_modified_iterating_set.py.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ modified_iterating_set.py:4:1: PLE4703 [*] Iterated set `nums` is being modified
1313
= help: Consider iterating through a copy of it instead.
1414

1515
Unsafe fix
16-
1 1 | # Positive cases
16+
1 1 | # Errors
1717
2 2 |
1818
3 3 | nums = {1, 2, 3}
1919
4 |-for num in nums:
@@ -92,7 +92,7 @@ modified_iterating_set.py:20:1: PLE4703 [*] Iterated set `colors` is being modif
9292
21 | | colors.remove("red")
9393
| |________________________^ PLE4703
9494
22 |
95-
23 | # Negative cases
95+
23 | # OK
9696
|
9797
= help: Consider iterating through a copy of it instead.
9898

@@ -104,4 +104,4 @@ modified_iterating_set.py:20:1: PLE4703 [*] Iterated set `colors` is being modif
104104
20 |+for color in colors.copy():
105105
21 21 | colors.remove("red")
106106
22 22 |
107-
23 23 | # Negative cases
107+
23 23 | # OK

0 commit comments

Comments
 (0)