Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Dec 9, 2024

Currently it is off by default since we haven't migrated any files over to the new format. To try it out, run dart ci/bin/format.dart -c dart -f.

Once we turn it on by default et will automatically format dart files as it calls into format.dart.

}

Future<int> _runDartFormat({required bool fixing}) async {
final List<String> filesToCheck = await getFileList(<String>['*.dart']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nit:

// Todo: we probably should just do this on single list of files rather than forking X processes.

  • dart formatter is pretty quick
  • engineers probably aren't going to make huge changes
  • most of the time is probably spent in process start

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had this modeled after the other language formatters in this file, which all use this pattern. It has the advantage of allowing us to print a nice diff between expected formatting vs. actual formatting. It is probably faster to just pass the list of files directly to the formatter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing a nice diff seems like a good motivation to follow the same pattern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to print a nice diff. We just need to tell people the files that are failing format checking. They should be running et format before they put the PR up (which in the engine's case is true).

}) : super(
repoDir: repoDir,
) {
// $ENGINE/flutter/third_party/dart/tools/sdks/dart-sdk/bin/dart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct, but FYI this is the prebuilt dev channel Dart SDK, and not the prebuilt Dart SDK whose version matches the hash in the DEPS file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zanderso For my own understanding: What's the difference between the two and where is the version of either of these specified?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The versions are specified in the DEPS file:

The prebuilt dev channel SDK is here:

engine/DEPS

Line 431 in 4d00124

{'dep_type': 'cipd', 'packages': [{'package': 'dart/dart-sdk/${{platform}}', 'version': 'git_revision:7fce3544047c41018b8c00b4453c0262f463dd74'}]},

vs.

here we download a prebuilt Dart SDK that matches the version of the Dart SDK source that is pulled into the engine:

engine/DEPS

Line 435 in 4d00124

# Prebuilt Dart SDK of the same revision as the Dart SDK source checkout

The version of the Dart SDK that the framework will be using is the second one.

}

Future<int> _runDartFormat({required bool fixing}) async {
final List<String> filesToCheck = await getFileList(<String>['*.dart']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Printing a nice diff seems like a good motivation to follow the same pattern.

goderbauer and others added 7 commits December 10, 2024 10:28
Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2024
@auto-submit auto-submit bot merged commit a8f7556 into flutter:main Dec 11, 2024
31 checks passed
@goderbauer goderbauer deleted the dartFormatter branch December 11, 2024 00:07
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 11, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 11, 2024
…160061)

flutter/engine@3a641b6...a8f7556

2024-12-11 goderbauer@google.com Add support for dart formatter
(flutter/engine#57075)
2024-12-10 skia-flutter-autoroll@skia.org Roll Skia from d541f1aa0c9b to
e4d2c3dbb848 (2 revisions) (flutter/engine#57106)
2024-12-10 skia-flutter-autoroll@skia.org Roll Dart SDK from
dd92932823d1 to f863f0b43625 (1 revision) (flutter/engine#57104)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jonahwilliams@google.com,zra@google.com on the revert to
ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
Currently it is off by default since we haven't migrated any files over to the new format. To try it out, run `dart ci/bin/format.dart -c dart -f`.

Once we turn it on by default `et` will automatically format dart files as it calls into `format.dart`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants