2
2
source : crates / ruff_linter / src / rules / ruff / mod .rs
3
3
snapshot_kind : text
4
4
-- -
5
- RUF051 .py :8 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
5
+ RUF051 .py :8 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
6
6
|
7
7
7 | if k in d : # Bare name
8
8
8 | del d [k ]
@@ -23,7 +23,7 @@ RUF051.py:8:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delete
23
23
10 9 | if ' ' in d : # String
24
24
11 10 | del d [" " ] # Different quotes
25
25
26
- RUF051 .py :11 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
26
+ RUF051 .py :11 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
27
27
|
28
28
10 | if ' ' in d : # String
29
29
11 | del d [" " ] # Different quotes
@@ -44,7 +44,7 @@ RUF051.py:11:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
44
44
13 12 | if b " " in d : # Bytes
45
45
14 13 | del d [ # Multiline slice
46
46
47
- RUF051 .py :14 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
47
+ RUF051 .py :14 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
48
48
|
49
49
13 | if b " " in d : # Bytes
50
50
14 | del d [ # Multiline slice
@@ -70,7 +70,7 @@ RUF051.py:14:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
70
70
18 15 | if 0 in d : del d [0 ] # Single - line statement
71
71
19 16 |
72
72
73
- RUF051 .py :18 :12 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
73
+ RUF051 .py :18 :12 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
74
74
|
75
75
16 | ]
76
76
17 |
@@ -91,7 +91,7 @@ RUF051.py:18:12: RUF051 [*] Use `pop` instead of `key in dict` followed by `dele
91
91
20 20 | if 3j in d : # Complex
92
92
21 21 | del d [3j ]
93
93
94
- RUF051 .py :21 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
94
+ RUF051 .py :21 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
95
95
|
96
96
20 | if 3j in d : # Complex
97
97
21 | del d [3j ]
@@ -112,7 +112,7 @@ RUF051.py:21:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
112
112
23 22 | if 0.1234 in d : # Float
113
113
24 23 | del d [.1_2_3_4 ] # Number separators and shorthand syntax
114
114
115
- RUF051 .py :24 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
115
+ RUF051 .py :24 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
116
116
|
117
117
23 | if 0.1234 in d : # Float
118
118
24 | del d [.1_2_3_4 ] # Number separators and shorthand syntax
@@ -133,7 +133,7 @@ RUF051.py:24:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
133
133
26 25 | if True in d : # True
134
134
27 26 | del d [True ]
135
135
136
- RUF051 .py :27 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
136
+ RUF051 .py :27 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
137
137
|
138
138
26 | if True in d : # True
139
139
27 | del d [True ]
@@ -154,7 +154,7 @@ RUF051.py:27:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
154
154
29 28 | if False in d : # False
155
155
30 29 | del d [False ]
156
156
157
- RUF051 .py :30 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
157
+ RUF051 .py :30 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
158
158
|
159
159
29 | if False in d : # False
160
160
30 | del d [False ]
@@ -175,7 +175,7 @@ RUF051.py:30:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
175
175
32 31 | if None in d : # None
176
176
33 32 | del d [
177
177
178
- RUF051 .py :33 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
178
+ RUF051 .py :33 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
179
179
|
180
180
32 | if None in d : # None
181
181
33 | del d [
@@ -203,7 +203,7 @@ RUF051.py:33:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
203
203
38 34 | if ... in d : # Ellipsis
204
204
39 35 | del d [
205
205
206
- RUF051 .py :39 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
206
+ RUF051 .py :39 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
207
207
|
208
208
38 | if ... in d : # Ellipsis
209
209
39 | del d [
@@ -229,7 +229,7 @@ RUF051.py:39:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
229
229
43 40 | if " a" " bc" in d : # String concatenation
230
230
44 41 | del d [' abc' ]
231
231
232
- RUF051 .py :44 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
232
+ RUF051 .py :44 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
233
233
|
234
234
43 | if " a" " bc" in d : # String concatenation
235
235
44 | del d [' abc' ]
@@ -250,7 +250,7 @@ RUF051.py:44:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
250
250
46 45 | if r " \f oo" in d : # Raw string
251
251
47 46 | del d [' \\ foo' ]
252
252
253
- RUF051 .py :47 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
253
+ RUF051 .py :47 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
254
254
|
255
255
46 | if r " \f oo" in d : # Raw string
256
256
47 | del d [' \\ foo' ]
@@ -271,7 +271,7 @@ RUF051.py:47:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
271
271
49 48 | if b ' yt' b ' es' in d : # Bytes concatenation
272
272
50 49 | del d [rb " " " ytes" " " ] # Raw bytes
273
273
274
- RUF051 .py :50 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
274
+ RUF051 .py :50 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
275
275
|
276
276
49 | if b ' yt' b ' es' in d : # Bytes concatenation
277
277
50 | del d [rb " " " ytes" " " ] # Raw bytes
@@ -292,7 +292,7 @@ RUF051.py:50:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
292
292
52 51 | if k in d :
293
293
53 52 | # comment that gets dropped
294
294
295
- RUF051 .py :54 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
295
+ RUF051 .py :54 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
296
296
|
297
297
52 | if k in d :
298
298
53 | # comment that gets dropped
@@ -315,7 +315,7 @@ RUF051.py:54:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
315
315
56 54 | ### Safely fixable
316
316
57 55 |
317
317
318
- RUF051 .py :59 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
318
+ RUF051 .py :59 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
319
319
|
320
320
58 | if k in d :
321
321
59 | del d [k ]
@@ -336,7 +336,7 @@ RUF051.py:59:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
336
336
61 60 | if ' ' in d :
337
337
62 61 | del d [" " ]
338
338
339
- RUF051 .py :62 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
339
+ RUF051 .py :62 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
340
340
|
341
341
61 | if ' ' in d :
342
342
62 | del d [" " ]
@@ -357,7 +357,7 @@ RUF051.py:62:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
357
357
64 63 | if b " " in d :
358
358
65 64 | del d [
359
359
360
- RUF051 .py :65 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
360
+ RUF051 .py :65 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
361
361
|
362
362
64 | if b " " in d :
363
363
65 | del d [
@@ -383,7 +383,7 @@ RUF051.py:65:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
383
383
69 66 | if 0 in d : del d [0 ]
384
384
70 67 |
385
385
386
- RUF051 .py :69 :12 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
386
+ RUF051 .py :69 :12 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
387
387
|
388
388
67 | ]
389
389
68 |
@@ -404,7 +404,7 @@ RUF051.py:69:12: RUF051 [*] Use `pop` instead of `key in dict` followed by `dele
404
404
71 71 | if 3j in d :
405
405
72 72 | del d [3j ]
406
406
407
- RUF051 .py :72 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
407
+ RUF051 .py :72 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
408
408
|
409
409
71 | if 3j in d :
410
410
72 | del d [3j ]
@@ -425,7 +425,7 @@ RUF051.py:72:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
425
425
74 73 | if 0.1234 in d :
426
426
75 74 | del d [.1_2_3_4 ]
427
427
428
- RUF051 .py :75 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
428
+ RUF051 .py :75 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
429
429
|
430
430
74 | if 0.1234 in d :
431
431
75 | del d [.1_2_3_4 ]
@@ -446,7 +446,7 @@ RUF051.py:75:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
446
446
77 76 | if True in d :
447
447
78 77 | del d [True ]
448
448
449
- RUF051 .py :78 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
449
+ RUF051 .py :78 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
450
450
|
451
451
77 | if True in d :
452
452
78 | del d [True ]
@@ -467,7 +467,7 @@ RUF051.py:78:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
467
467
80 79 | if False in d :
468
468
81 80 | del d [False ]
469
469
470
- RUF051 .py :81 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
470
+ RUF051 .py :81 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
471
471
|
472
472
80 | if False in d :
473
473
81 | del d [False ]
@@ -488,7 +488,7 @@ RUF051.py:81:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
488
488
83 82 | if None in d :
489
489
84 83 | del d [
490
490
491
- RUF051 .py :84 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
491
+ RUF051 .py :84 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
492
492
|
493
493
83 | if None in d :
494
494
84 | del d [
@@ -514,7 +514,7 @@ RUF051.py:84:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
514
514
88 85 | if ... in d :
515
515
89 86 | del d [
516
516
517
- RUF051 .py :89 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
517
+ RUF051 .py :89 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
518
518
|
519
519
88 | if ... in d :
520
520
89 | del d [
@@ -538,7 +538,7 @@ RUF051.py:89:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
538
538
92 90 | if " a" " bc" in d :
539
539
93 91 | del d [' abc' ]
540
540
541
- RUF051 .py :93 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
541
+ RUF051 .py :93 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
542
542
|
543
543
92 | if " a" " bc" in d :
544
544
93 | del d [' abc' ]
@@ -559,7 +559,7 @@ RUF051.py:93:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
559
559
95 94 | if r " \f oo" in d :
560
560
96 95 | del d [' \\ foo' ]
561
561
562
- RUF051 .py :96 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
562
+ RUF051 .py :96 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
563
563
|
564
564
95 | if r " \f oo" in d :
565
565
96 | del d [' \\ foo' ]
@@ -580,7 +580,7 @@ RUF051.py:96:5: RUF051 [*] Use `pop` instead of `key in dict` followed by `delet
580
580
98 97 | if b ' yt' b ' es' in d :
581
581
99 98 | del d [rb " " " ytes" " " ] # This should not make the fix unsafe
582
582
583
- RUF051 .py :99 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` delete dict[key]`
583
+ RUF051 .py :99 :5 : RUF051 [* ] Use ` pop` instead of ` key in dict` followed by ` del dict[key]`
584
584
|
585
585
98 | if b ' yt' b ' es' in d :
586
586
99 | del d [rb " " " ytes" " " ] # This should not make the fix unsafe
0 commit comments