Commit 483567e
committed
Auto merge of rust-lang#56595 - ljedrz:x_py_clippy_fix, r=oli-obk
Add clippy and fix commands to x.py
Since they are kind of similar in nature, I have used the same approach as for `cargo check`. At least some of the boilerplate could probably be shared, but I'd prefer to gather some feedback before I decide to merge them more aggressively.
This works reasonably well for `clippy`; with `-A clippy::all` and some extra `#![feature(rustc_private)]`s almost the whole codebase can be processed. There are some concerns, though:
- unlike `check`, in order to be able to traverse all the crates, some of them need to be marked with the `#![feature(rustc_private)]` attribute
- `-W clippy::all` breaks on any error. Is there a way to produce errors but not have them break the progress?
- I'm not sure how to redirect the errors in a way that would show colors; for now I was able to de-jsonize and print them (something not needed for `check`)
`cargo fix` is much more stubborn; it refuses to acknowledge crates like `core` and `std`, so it doesn't progress much at all.
Since this is a bit more tricky than I have envisioned, I need some guidance:
- is this the right approach or am I doing something very wrong ^^?
- why are the extra `rustc_private` features necessary? I was hoping for the same treatment as `check`
- are changes in `clippy` and `cargo fix` needed e.g. in order to produce errors in the same manner as `check` or did I miss something?
- do we need this level of file granularity (e.g. for futureproofing) or can `check`, `clippy` and `fix` files be condensed?
Hopes-to-fix: rust-lang#53896
Cc @alexcrichton, @zackmdavisFile tree
5 files changed
+105
-17
lines changed- src/bootstrap
5 files changed
+105
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
362 | | - | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| |||
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
| 525 | + | |
| 526 | + | |
523 | 527 | | |
524 | 528 | | |
525 | 529 | | |
| |||
757 | 761 | | |
758 | 762 | | |
759 | 763 | | |
760 | | - | |
| 764 | + | |
761 | 765 | | |
762 | 766 | | |
763 | 767 | | |
764 | 768 | | |
765 | | - | |
| 769 | + | |
766 | 770 | | |
767 | 771 | | |
768 | 772 | | |
769 | 773 | | |
770 | | - | |
| 774 | + | |
771 | 775 | | |
772 | 776 | | |
773 | 777 | | |
| |||
831 | 835 | | |
832 | 836 | | |
833 | 837 | | |
834 | | - | |
835 | | - | |
836 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
837 | 841 | | |
838 | 842 | | |
839 | 843 | | |
| |||
898 | 902 | | |
899 | 903 | | |
900 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
| |||
966 | 975 | | |
967 | 976 | | |
968 | 977 | | |
969 | | - | |
| 978 | + | |
970 | 979 | | |
971 | 980 | | |
972 | 981 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
16 | 32 | | |
17 | 33 | | |
18 | 34 | | |
| |||
31 | 47 | | |
32 | 48 | | |
33 | 49 | | |
34 | | - | |
| 50 | + | |
35 | 51 | | |
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
39 | 55 | | |
40 | 56 | | |
| 57 | + | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
| |||
78 | 95 | | |
79 | 96 | | |
80 | 97 | | |
81 | | - | |
| 98 | + | |
| 99 | + | |
82 | 100 | | |
83 | 101 | | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
87 | 105 | | |
| 106 | + | |
88 | 107 | | |
89 | 108 | | |
90 | 109 | | |
| |||
127 | 146 | | |
128 | 147 | | |
129 | 148 | | |
130 | | - | |
| 149 | + | |
| 150 | + | |
131 | 151 | | |
132 | 152 | | |
133 | 153 | | |
| |||
136 | 156 | | |
137 | 157 | | |
138 | 158 | | |
| 159 | + | |
139 | 160 | | |
140 | 161 | | |
141 | 162 | | |
| |||
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
169 | | - | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
| 197 | + | |
176 | 198 | | |
177 | 199 | | |
178 | 200 | | |
| |||
212 | 234 | | |
213 | 235 | | |
214 | 236 | | |
215 | | - | |
| 237 | + | |
216 | 238 | | |
217 | 239 | | |
218 | 240 | | |
| |||
221 | 243 | | |
222 | 244 | | |
223 | 245 | | |
| 246 | + | |
224 | 247 | | |
225 | 248 | | |
226 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
| 429 | + | |
428 | 430 | | |
429 | 431 | | |
430 | 432 | | |
| |||
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
| 561 | + | |
559 | 562 | | |
560 | 563 | | |
561 | 564 | | |
| |||
707 | 710 | | |
708 | 711 | | |
709 | 712 | | |
| 713 | + | |
710 | 714 | | |
711 | 715 | | |
712 | 716 | | |
| |||
1077 | 1081 | | |
1078 | 1082 | | |
1079 | 1083 | | |
| 1084 | + | |
1080 | 1085 | | |
1081 | 1086 | | |
1082 | 1087 | | |
| |||
1099 | 1104 | | |
1100 | 1105 | | |
1101 | 1106 | | |
1102 | | - | |
| 1107 | + | |
1103 | 1108 | | |
1104 | 1109 | | |
1105 | 1110 | | |
| |||
1108 | 1113 | | |
1109 | 1114 | | |
1110 | 1115 | | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1111 | 1120 | | |
1112 | 1121 | | |
1113 | 1122 | | |
| |||
1235 | 1244 | | |
1236 | 1245 | | |
1237 | 1246 | | |
| 1247 | + | |
1238 | 1248 | | |
1239 | 1249 | | |
1240 | 1250 | | |
| |||
1245 | 1255 | | |
1246 | 1256 | | |
1247 | 1257 | | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
1248 | 1262 | | |
1249 | 1263 | | |
1250 | 1264 | | |
| |||
1291 | 1305 | | |
1292 | 1306 | | |
1293 | 1307 | | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1294 | 1311 | | |
1295 | 1312 | | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| |||
146 | 154 | | |
147 | 155 | | |
148 | 156 | | |
| 157 | + | |
| 158 | + | |
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
| |||
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
284 | 316 | | |
285 | 317 | | |
286 | 318 | | |
| |||
363 | 395 | | |
364 | 396 | | |
365 | 397 | | |
| 398 | + | |
| 399 | + | |
366 | 400 | | |
367 | 401 | | |
368 | 402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
0 commit comments