1
1
-- -
2
2
source : crates / ruff_linter / src / rules / flake8_pie / mod .rs
3
3
-- -
4
- PIE804 .py :1 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
4
+ PIE804 .py :1 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
5
5
|
6
6
1 | foo (** {" bar" : True }) # PIE804
7
- | ^^^^^ ^^^^^^^^^^^^^^^ PIE804
7
+ | ^^^^^^^^^^^^^^^ PIE804
8
8
2 |
9
9
3 | foo (** {" r2d2" : True }) # PIE804
10
10
|
@@ -17,12 +17,12 @@ PIE804.py:1:1: PIE804 [*] Unnecessary `dict` kwargs
17
17
3 3 | foo (** {" r2d2" : True }) # PIE804
18
18
4 4 |
19
19
20
- PIE804 .py :3 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
20
+ PIE804 .py :3 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
21
21
|
22
22
1 | foo (** {" bar" : True }) # PIE804
23
23
2 |
24
24
3 | foo (** {" r2d2" : True }) # PIE804
25
- | ^^^^^ ^^^^^^^^^^^^^^^^ PIE804
25
+ | ^^^^^^^^^^^^^^^^ PIE804
26
26
4 |
27
27
5 | Foo .objects .create (** {" bar" : True }) # PIE804
28
28
|
@@ -37,12 +37,12 @@ PIE804.py:3:1: PIE804 [*] Unnecessary `dict` kwargs
37
37
5 5 | Foo .objects .create (** {" bar" : True }) # PIE804
38
38
6 6 |
39
39
40
- PIE804 .py :5 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
40
+ PIE804 .py :5 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
41
41
|
42
42
3 | foo (** {" r2d2" : True }) # PIE804
43
43
4 |
44
44
5 | Foo .objects .create (** {" bar" : True }) # PIE804
45
- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ PIE804
45
+ | ^^^^^^^^^^^^^^^ PIE804
46
46
6 |
47
47
7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
48
48
|
@@ -58,12 +58,12 @@ PIE804.py:5:1: PIE804 [*] Unnecessary `dict` kwargs
58
58
7 7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
59
59
8 8 |
60
60
61
- PIE804 .py :7 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
61
+ PIE804 .py :7 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
62
62
|
63
63
5 | Foo .objects .create (** {" bar" : True }) # PIE804
64
64
6 |
65
65
7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
66
- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ PIE804
66
+ | ^^^^^^^^^^^^^^^^^^ PIE804
67
67
8 |
68
68
9 | Foo .objects .create (** {**bar }) # PIE804
69
69
|
@@ -79,12 +79,12 @@ PIE804.py:7:1: PIE804 [*] Unnecessary `dict` kwargs
79
79
9 9 | Foo .objects .create (** {**bar }) # PIE804
80
80
10 10 |
81
81
82
- PIE804 .py :9 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
82
+ PIE804 .py :9 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
83
83
|
84
84
7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
85
85
8 |
86
86
9 | Foo .objects .create (** {**bar }) # PIE804
87
- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ PIE804
87
+ | ^^^^^^^^^ PIE804
88
88
10 |
89
89
11 | foo (** {})
90
90
|
@@ -100,12 +100,12 @@ PIE804.py:9:1: PIE804 [*] Unnecessary `dict` kwargs
100
100
11 11 | foo (** {})
101
101
12 12 |
102
102
103
- PIE804 .py :11 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
103
+ PIE804 .py :11 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
104
104
|
105
105
9 | Foo .objects .create (** {**bar }) # PIE804
106
106
10 |
107
107
11 | foo (** {})
108
- | ^^^^^ ^^^^ PIE804
108
+ | ^^^^ PIE804
109
109
12 |
110
110
13 | foo (** {**data , " foo" : " buzz" })
111
111
|
@@ -121,20 +121,68 @@ PIE804.py:11:1: PIE804 [*] Unnecessary `dict` kwargs
121
121
13 13 | foo (** {**data , " foo" : " buzz" })
122
122
14 14 | foo (** buzz )
123
123
124
- PIE804 .py :23 : 1 : PIE804 [* ] Unnecessary ` dict` kwargs
124
+ PIE804 .py :22 : 5 : PIE804 [* ] Unnecessary ` dict` kwargs
125
125
|
126
+ 20 | foo (** {f" buzz__{bar}" : True })
126
127
21 | abc (** {" for" : 3 })
127
- 22 |
128
- 23 | foo (** {},)
129
- | ^^^^^^^^^^ PIE804
128
+ 22 | foo (** {},)
129
+ | ^^^^ PIE804
130
+ 23 |
131
+ 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
130
132
|
131
133
= help : Remove unnecessary kwargs
132
134
133
135
ℹ Safe fix
136
+ 19 19 | foo (** {" " : True })
134
137
20 20 | foo (** {f" buzz__{bar}" : True })
135
138
21 21 | abc (** {" for" : 3 })
136
- 22 22 |
137
- 23 | - foo (** {},)
138
- 23 | + foo ()
139
+ 22 | - foo (** {},)
140
+ 22 | + foo ()
141
+ 23 23 |
142
+ 24 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
143
+ 25 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
144
+
145
+ PIE804 .py :25 :5 : PIE804 Unnecessary ` dict` kwargs
146
+ |
147
+ 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
148
+ 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
149
+ | ^^^^^^^^^^ PIE804
150
+ 26 | abc (a = 1 , ** {' a' : c }, ** {' b' : c }) # PIE804
151
+ |
152
+ = help : Remove unnecessary kwargs
153
+
154
+ PIE804 .py :25 :17 : PIE804 Unnecessary ` dict` kwargs
155
+ |
156
+ 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
157
+ 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
158
+ | ^^^^^^^^^^ PIE804
159
+ 26 | abc (a = 1 , ** {' a' : c }, ** {' b' : c }) # PIE804
160
+ |
161
+ = help : Remove unnecessary kwargs
162
+
163
+ PIE804 .py :26 :10 : PIE804 Unnecessary ` dict` kwargs
164
+ |
165
+ 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
166
+ 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
167
+ 26 | abc (a = 1 , ** {' a' : c }, ** {' b' : c }) # PIE804
168
+ | ^^^^^^^^^^ PIE804
169
+ |
170
+ = help : Remove unnecessary kwargs
171
+
172
+ PIE804 .py :26 :22 : PIE804 [* ] Unnecessary ` dict` kwargs
173
+ |
174
+ 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
175
+ 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
176
+ 26 | abc (a = 1 , ** {' a' : c }, ** {' b' : c }) # PIE804
177
+ | ^^^^^^^^^^ PIE804
178
+ |
179
+ = help : Remove unnecessary kwargs
180
+
181
+ ℹ Safe fix
182
+ 23 23 |
183
+ 24 24 | # Duplicated key names won ' t be fixed, to avoid syntax errors.
184
+ 25 25 | abc (** {' a' : b }, ** {' a' : c }) # PIE804
185
+ 26 | - abc (a = 1 , ** {' a' : c }, ** {' b' : c }) # PIE804
186
+ 26 | + abc (a = 1 , ** {' a' : c }, b = c ) # PIE804
139
187
140
188
0 commit comments