Auto-format Framework (#160545)

This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
Michael Goderbauer
2024-12-19 12:06:21 -08:00
committed by GitHub
parent 8e0993eda8
commit 5491c8c146
4411 changed files with 455108 additions and 415991 deletions

View File

@@ -22,13 +22,15 @@ Future<void> main() async {
print('daemon process started, pid: ${daemon.pid}');
daemon.stdout
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
.listen((String line) => print('<== $line'));
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
.listen((String line) => print('<== $line'));
daemon.stderr.listen(stderr.add);
stdout.write('> ');
stdin.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen((String line) {
stdin.transform<String>(utf8.decoder).transform<String>(const LineSplitter()).listen((
String line,
) {
final List<String> words = line.split(' ');
if (line == 'version' || line == 'v') {
@@ -71,8 +73,7 @@ Future<void> main() async {
'method': 'emulator.launch',
'params': <String, dynamic>{
'emulatorId': words[1],
if (words.contains('coldBoot'))
'coldBoot': true,
if (words.contains('coldBoot')) 'coldBoot': true,
},
});
} else if (line == 'enable') {
@@ -84,10 +85,12 @@ Future<void> main() async {
});
// Print in the callback can't fail.
unawaited(daemon.exitCode.then<int>((int code) {
print('daemon exiting ($code)');
exit(code);
}));
unawaited(
daemon.exitCode.then<int>((int code) {
print('daemon exiting ($code)');
exit(code);
}),
);
}
int id = 0;

View File

@@ -44,10 +44,13 @@ void main(List<String> args) {
for (final Coverage coverage in coverages) {
overallNumerator += coverage.testedLines;
overallDenominator += coverage.totalLines;
final String coveragePercent = (coverage.testedLines / coverage.totalLines * 100).toStringAsFixed(2);
print('${coverage.library}: $coveragePercent% | ${coverage.testedLines} | ${coverage.totalLines}');
final String coveragePercent = (coverage.testedLines / coverage.totalLines * 100)
.toStringAsFixed(2);
print(
'${coverage.library}: $coveragePercent% | ${coverage.testedLines} | ${coverage.totalLines}',
);
}
print('OVERALL: ${overallNumerator/overallDenominator}');
print('OVERALL: ${overallNumerator / overallDenominator}');
}
class Coverage {