• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / tools / 33021502852
94%

Build:
DEFAULT BRANCH: main
Ran 26 Aug 2026 11:29PM UTC
Jobs 6
Files 9
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Aug 2026 10:57PM UTC coverage: 96.7% (+2.8%) from 93.896%
33021502852

push

github

web-flow
Fix trailing comma when adding to flow collections in yaml_edit (#2533)

Fixes https://github.com/dart-lang/tools/issues/2532

### Problem
When appending elements to a flow list (`[...]`) or adding keys to a flow map (`{...}`) that contains a trailing comma, `yaml_edit` unconditionally prepended a comma without checking for the existing trailing comma. This produced invalid double-comma syntax (e.g. `, \n , android/**]`), failing internal YAML parsing validation with an assertion error.

Furthermore, multiline flow collections with trailing commas had their newly appended elements and closing delimiters misaligned on column 0.

### Solution
1. **Trailing Comma Detection**:
   - Added `betweenHasTrailingComma` in `pkgs/yaml_edit/lib/src/utils.dart` to check if a comma exists between the last element and the closing delimiter while ignoring comments (`# ...`).
   - If a trailing comma is present, `_appendToFlowList` and `_addToFlowMap` avoid prepending an extra comma and preserve the trailing comma style.
2. **Multiline Indentation Alignment**:
   - Added `formatMultilineFlowTrailingEntry` in `pkgs/yaml_edit/lib/src/utils.dart` to calculate the indentation difference between collection elements and the closing delimiter.
   - Newly appended items in multiline flow lists and maps are now indented to match preceding entries, with the closing delimiter remaining on its own indented line.
3. **Tests**:
   - Added unit tests covering multiline flow lists/maps with and without trailing commas, comments, and nested structures in `pkgs/yaml_edit/test/append_test.dart` and `pkgs/yaml_edit/test/update_test.dart`.
4. **Changelog**:
   - Updated `pkgs/yaml_edit/CHANGELOG.md`.

52 of 54 new or added lines in 3 files covered. (96.3%)

967 of 1000 relevant lines covered (96.7%)

53.48 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
95.81
pkgs/yaml_edit/lib/src/utils.dart
Jobs
ID Job ID Ran Files Coverage
1 os:ubuntu-latest/dart:dev/platform:chrome - 33021502852.1 26 Aug 2026 11:31PM UTC 9
92.01
GitHub Action Run
2 os:ubuntu-latest/dart:stable/platform:vm - 33021502852.2 26 Aug 2026 11:29PM UTC 9
94.64
GitHub Action Run
3 os:ubuntu-latest/dart:3.1/platform:chrome - 33021502852.3 26 Aug 2026 11:33PM UTC 9
92.0
GitHub Action Run
4 os:ubuntu-latest/dart:3.1/platform:vm - 33021502852.4 26 Aug 2026 11:29PM UTC 9
94.42
GitHub Action Run
5 os:ubuntu-latest/dart:stable/platform:chrome - 33021502852.5 26 Aug 2026 11:31PM UTC 9
92.01
GitHub Action Run
6 os:ubuntu-latest/dart:dev/platform:vm - 33021502852.6 26 Aug 2026 11:29PM UTC 9
94.64
GitHub Action Run
Source Files on build 33021502852
  • Tree
  • List 9
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33021502852
  • 5f02a37c on github
  • Prev Build on main (#32789397472)
  • Next Build on main (#33282776571)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc