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

@@ -7,8 +7,9 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('test', (WidgetTester tester) async {
final AnimationSheetBuilder animationSheet =
AnimationSheetBuilder(frameSize: const Size(48, 24));
final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(
frameSize: const Size(48, 24),
);
// This line will remain unchanged as there is no replacement for the
// `sheetSize` API.

View File

@@ -7,8 +7,9 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('test', (WidgetTester tester) async {
final AnimationSheetBuilder animationSheet =
AnimationSheetBuilder(frameSize: const Size(48, 24));
final AnimationSheetBuilder animationSheet = AnimationSheetBuilder(
frameSize: const Size(48, 24),
);
// This line will remain unchanged as there is no replacement for the
// `sheetSize` API.

View File

@@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
final binding = AutomatedTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async { },
() { },
() async {},
() {},
// Changes made in https://github.com/flutter/flutter/pull/89952
timeout: Duration(minutes: 30),
);

View File

@@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
final binding = AutomatedTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async { },
() { },
() async {},
() {},
);
}

View File

@@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
final binding = LiveTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async { },
() { },
() async {},
() {},
// Changes made in https://github.com/flutter/flutter/pull/89952
timeout: Duration(minutes: 30),
);

View File

@@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
final binding = LiveTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async { },
() { },
() async {},
() {},
);
}

View File

@@ -8,7 +8,8 @@ import 'package:clock/src/clock.dart';
import 'package:flutter_test/flutter_test.dart';
void main() async {
TestWidgetsFlutterBinding binding = AutomatedTestWidgetsFlutterBinding.ensureInitialized();
TestWidgetsFlutterBinding binding =
AutomatedTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async {
// This will be unchanged as there is no equivalent API.
@@ -20,7 +21,7 @@ void main() async {
additionalTime: Duration(seconds: 25),
);
},
() { },
() {},
// This timeout will be removed and not replaced since there is no
// equivalent API at this layer.
timeout: Duration(minutes: 30),

View File

@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_test/flutter_test.dart';
void main() async {
TestWidgetsFlutterBinding binding = AutomatedTestWidgetsFlutterBinding.ensureInitialized();
TestWidgetsFlutterBinding binding =
AutomatedTestWidgetsFlutterBinding.ensureInitialized();
binding.runTest(
() async {
// This will be unchanged as there is no equivalent API.
@@ -15,6 +17,6 @@ void main() async {
() async {},
);
},
() { },
() {},
);
}

View File

@@ -14,6 +14,9 @@ void main() {
tester.semantics.simulatedAccessibilityTraversal();
tester.semantics.simulatedAccessibilityTraversal(start: theStart);
tester.semantics.simulatedAccessibilityTraversal(end: theEnd);
tester.semantics.simulatedAccessibilityTraversal(start: theStart, end: theEnd);
tester.semantics.simulatedAccessibilityTraversal(
start: theStart,
end: theEnd,
);
});
}

View File

@@ -14,6 +14,8 @@ void main() {
tester.semantics.simulatedAccessibilityTraversal();
tester.semantics.simulatedAccessibilityTraversal(startNode: theStart);
tester.semantics.simulatedAccessibilityTraversal(endNode: theEnd);
tester.semantics.simulatedAccessibilityTraversal(startNode: theStart, endNode: theEnd);
tester.semantics.simulatedAccessibilityTraversal(
startNode: theStart, endNode: theEnd,
);
});
}

View File

@@ -10,12 +10,15 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/89952
}, timeout: Timeout(Duration(hours: 1)));
testWidgets('test', (WidgetTester tester) async {
// The `timeout` will remain unchanged, but `initialTimeout` will be removed
// Changes made in https://github.com/flutter/flutter/pull/89952
},
timeout: Timeout(Duration(minutes: 45)),
initialTimeout: Duration(minutes: 30));
testWidgets(
'test',
(WidgetTester tester) async {
// The `timeout` will remain unchanged, but `initialTimeout` will be removed
// Changes made in https://github.com/flutter/flutter/pull/89952
},
timeout: Timeout(Duration(minutes: 45)),
initialTimeout: Duration(minutes: 30),
);
testWidgets('test', (WidgetTester tester) async {
// initialTimeout will be wrapped in a Timeout and changed to `timeout`

View File

@@ -10,11 +10,14 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/89952
}, timeout: Timeout(Duration(hours: 1)));
testWidgets('test', (WidgetTester tester) async {
// The `timeout` will remain unchanged, but `initialTimeout` will be removed
// Changes made in https://github.com/flutter/flutter/pull/89952
},
timeout: Timeout(Duration(minutes: 45)));
testWidgets(
'test',
(WidgetTester tester) async {
// The `timeout` will remain unchanged, but `initialTimeout` will be removed
// Changes made in https://github.com/flutter/flutter/pull/89952
},
timeout: Timeout(Duration(minutes: 45)),
);
testWidgets('test', (WidgetTester tester) async {
// initialTimeout will be wrapped in a Timeout and changed to `timeout`