Repository navigation
Commit 4c5c588
authored
Avoid eagerly reading sources for singe-file batches (#21996)
Fixes #21514
Currently, `parse_file()` (that is still used with parallel parsing if
there is only one file in batch) eagerly reads file, computes hash, and
parses inline configuration. This is not needed, since Ruff parser
already does this. This PR unifies the logic in `parse_file()` with
`parse_all()` that already avoids this overhead.
Note that few tests changed because Ruff parser ignores `# coding:`
declaration and always uses UTF-8.1 parent 7e00ff0 commit 4c5c588
3 files changed
Lines changed: 38 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
| 1035 | + | |
1038 | 1036 | | |
1039 | 1037 | | |
1040 | 1038 | | |
| |||
1077 | 1075 | | |
1078 | 1076 | | |
1079 | 1077 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | 1078 | | |
1088 | 1079 | | |
1089 | 1080 | | |
| |||
3146 | 3137 | | |
3147 | 3138 | | |
3148 | 3139 | | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
3149 | 3160 | | |
3150 | 3161 | | |
3151 | 3162 | | |
| |||
3211 | 3222 | | |
3212 | 3223 | | |
3213 | 3224 | | |
3214 | | - | |
| 3225 | + | |
3215 | 3226 | | |
3216 | 3227 | | |
3217 | | - | |
| 3228 | + | |
3218 | 3229 | | |
3219 | 3230 | | |
3220 | 3231 | | |
| |||
3235 | 3246 | | |
3236 | 3247 | | |
3237 | 3248 | | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
3238 | 3252 | | |
3239 | 3253 | | |
3240 | 3254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
0 commit comments