Repository navigation
Commit e03b8f9
authored
[stable] [flutter_tools] Fix crash when migrating flow-style exclude lists in analysis_options.yaml (#191598)
### Issue Link:
#191060
### Impact Description:
When `analysis_options.yaml` uses YAML flow-style lists for `analyzer: { exclude: [...] }`, `flutter pub get` or `dart fix` crashes with a `_YamlAssertionError` when attempting to migrate and append platform exclusions. This completely blocks project preparation and tooling execution for projects using flow-style YAML syntax.
### Changelog Description:
[flutter/191060] When `analysis_options.yaml` contains flow-style `exclude:` sequences, `AnalysisOptionsMigration` converts the node to block style before appending to avoid `YamlEditor` assertion crashes.
### Workaround:
Manually edit `analysis_options.yaml` to convert the `exclude:` list from flow style (`[a, b]`) to standard block style (`- a\n- b`).
### Risk:
### Test Coverage:
### Validation Steps:
1. Create a Flutter project with `analysis_options.yaml` containing a flow-style `exclude:` list (e.g. `analyzer:\n exclude: [build/**]`).
2. Run `flutter pub get`.
3. Verify that `flutter pub get` succeeds without a `_YamlAssertionError` crash and correctly migrates the excluded directories.1 parent e57eab8 commit e03b8f9
2 files changed
Lines changed: 39 additions & 0 deletions
File tree
- packages/flutter_tools
- lib/src/migrations
- test/general.shard/migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
207 | 237 | | |
208 | 238 | | |
209 | 239 | | |
| |||
0 commit comments