11-- -
22source : crates / ruff_linter / src / rules / flake8_pie / mod .rs
33-- -
4- PIE804 .py :1 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
4+ PIE804 .py :1 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
55 |
661 | foo (** {" bar" : True }) # PIE804
7- | ^^^^^ ^^^^^^^^^^^^^^^ PIE804
7+ | ^^^^^^^^^^^^^^^ PIE804
882 |
993 | foo (** {" r2d2" : True }) # PIE804
1010 |
@@ -17,12 +17,12 @@ PIE804.py:1:1: PIE804 [*] Unnecessary `dict` kwargs
17173 3 | foo (** {" r2d2" : True }) # PIE804
18184 4 |
1919
20- PIE804 .py :3 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
20+ PIE804 .py :3 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
2121 |
22221 | foo (** {" bar" : True }) # PIE804
23232 |
24243 | foo (** {" r2d2" : True }) # PIE804
25- | ^^^^^ ^^^^^^^^^^^^^^^^ PIE804
25+ | ^^^^^^^^^^^^^^^^ PIE804
26264 |
27275 | Foo .objects .create (** {" bar" : True }) # PIE804
2828 |
@@ -37,12 +37,12 @@ PIE804.py:3:1: PIE804 [*] Unnecessary `dict` kwargs
37375 5 | Foo .objects .create (** {" bar" : True }) # PIE804
38386 6 |
3939
40- PIE804 .py :5 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
40+ PIE804 .py :5 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
4141 |
42423 | foo (** {" r2d2" : True }) # PIE804
43434 |
44445 | Foo .objects .create (** {" bar" : True }) # PIE804
45- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ PIE804
45+ | ^^^^^^^^^^^^^^^ PIE804
46466 |
47477 | Foo .objects .create (** {" _id" : some_id }) # PIE804
4848 |
@@ -58,12 +58,12 @@ PIE804.py:5:1: PIE804 [*] Unnecessary `dict` kwargs
58587 7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
59598 8 |
6060
61- PIE804 .py :7 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
61+ PIE804 .py :7 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
6262 |
63635 | Foo .objects .create (** {" bar" : True }) # PIE804
64646 |
65657 | Foo .objects .create (** {" _id" : some_id }) # PIE804
66- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ PIE804
66+ | ^^^^^^^^^^^^^^^^^^ PIE804
67678 |
68689 | Foo .objects .create (** {**bar }) # PIE804
6969 |
@@ -79,12 +79,12 @@ PIE804.py:7:1: PIE804 [*] Unnecessary `dict` kwargs
79799 9 | Foo .objects .create (** {**bar }) # PIE804
808010 10 |
8181
82- PIE804 .py :9 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
82+ PIE804 .py :9 :20 : PIE804 [* ] Unnecessary ` dict` kwargs
8383 |
8484 7 | Foo .objects .create (** {" _id" : some_id }) # PIE804
8585 8 |
8686 9 | Foo .objects .create (** {**bar }) # PIE804
87- | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ PIE804
87+ | ^^^^^^^^^ PIE804
888810 |
898911 | foo (** {})
9090 |
@@ -100,12 +100,12 @@ PIE804.py:9:1: PIE804 [*] Unnecessary `dict` kwargs
10010011 11 | foo (** {})
10110112 12 |
102102
103- PIE804 .py :11 :1 : PIE804 [* ] Unnecessary ` dict` kwargs
103+ PIE804 .py :11 :5 : PIE804 [* ] Unnecessary ` dict` kwargs
104104 |
105105 9 | Foo .objects .create (** {**bar }) # PIE804
10610610 |
10710711 | foo (** {})
108- | ^^^^^ ^^^^ PIE804
108+ | ^^^^ PIE804
10910912 |
11011013 | foo (** {**data , " foo" : " buzz" })
111111 |
@@ -121,20 +121,68 @@ PIE804.py:11:1: PIE804 [*] Unnecessary `dict` kwargs
12112113 13 | foo (** {**data , " foo" : " buzz" })
12212214 14 | foo (** buzz )
123123
124- PIE804 .py :23 : 1 : PIE804 [* ] Unnecessary ` dict` kwargs
124+ PIE804 .py :22 : 5 : PIE804 [* ] Unnecessary ` dict` kwargs
125125 |
126+ 20 | foo (** {f" buzz__{bar}" : True })
12612721 | 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.
130132 |
131133 = help : Remove unnecessary kwargs
132134
133135ℹ Safe fix
136+ 19 19 | foo (** {" " : True })
13413720 20 | foo (** {f" buzz__{bar}" : True })
13513821 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
139187
140188
0 commit comments