[dart-announce] Proposal to change how dart format handles cascades

42 views
Skip to first unread message

'Bob Nystrom' via Dart Announcements

unread,
Jun 16, 2021, 6:44:07 PM6/16/21
to announce
Welcome aboard the maiden voyage of the new change process for dart format. I’m proposing three changes to how cascades are formatted. In principle, we could do them separately, but the first two made it easier to implement the third, so I lumped them together.

I tested the changes on 6,413,157 lines of pub packages. The new formatting rules lead to 1 changed line for every ~1100 lines of code (or ~0.09% of lines). Despite that small output change, performance is significantly improved. On my computer, formatting the corpus went from 260.84s to 111.83s. (In other words, this change makes dart format more than twice as fast overall.)

Unless persuaded otherwise, I plan to merge the changes into master next week. If you have feedback, please provide it on the pull request:


In particular, I’ll look at 👍and 👎 to gauge overall sentiment.

The pull request has full details on all of the changes.

Cheers!

– bob

--
For more ways to connect visit https://dart.dev/community
Reply all
Reply to author
Forward
0 new messages