Commit 321dfea
[analyzer/cfe] Always use pre-built SDK for formatting generated files.
Change the following code paths so that they format Dart code by
running `tools/sdks/dart-sdk/bin/dart format` as a subprocess:
- `generate_messages.dart` (this is the CFE tool that generates
`pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart` and
`pkg/front_end/lib/src/codes/cfe_codes_generated.dart`).
- `generated_files_up_to_date_git_test.dart` (this is a CFE test that
verifies that
`pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart` and
`pkg/front_end/lib/src/codes/cfe_codes_generated.dart` are up to
date).
- `GeneratedFile.generate` (this is the common method used by most
analyzer code generators).
- `GeneratedContentExtension.check` (this is used by analyzer tests to
verify that generated files are up to date).
- `relevance_table_generator.dart` (this is an `analysis_server` tool
that generates `relevance_tables*.g.dart` files).
Previously, these tools were inconsistent; some of them invoked the
formatter through its Dart API, and some of them ran `dart format` as
a subprocess via whatever `dart` executable was currently being used
for the parent process. This led to a risk that a generated file might
be immediately rejected by its own "up to date" test, or by the
presubmit script. Standardizing on the use of
`tools/sdks/dart-sdk/bin/dart format` (which is what the presubmit
script uses) should address this risk.
Addresses code review comments:
https://dart-review.googlesource.com/c/sdk/+/447920/comment/e9e1aa39_6fffc7e5/.
Change-Id: I6a6a69643a69505dc6e30547e0e784358458c357
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448161
Commit-Queue: Paul Berry <[email protected]>
Reviewed-by: Jens Johansen <[email protected]>1 parent a2af8a5 commit 321dfea
File tree
4 files changed
+32
-9
lines changed- pkg
- analyzer_utilities
- lib
- front_end/test
4 files changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
253 | 275 | | |
254 | 276 | | |
255 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
| 147 | + | |
146 | 148 | | |
147 | | - | |
| 149 | + | |
148 | 150 | | |
149 | 151 | | |
150 | 152 | | |
| |||
0 commit comments