Skip to content

Commit e1e0a19

Browse files
Hixiegilnobrega
authored andcommitted
Rewrap some lines that are about to get much longer. (flutter#146803)
This is part 10 of a broken down version of the flutter#140101 refactor. This will make future PRs easier to review.
1 parent 2c40f5b commit e1e0a19

File tree

1 file changed

+38
-10
lines changed

1 file changed

+38
-10
lines changed

packages/flutter_goldens/lib/flutter_goldens.dart

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,19 @@ Future<void> testExecutable(FutureOr<void> Function() testMain, {String? namePre
4242
const Platform platform = LocalPlatform();
4343
const FileSystem fs = LocalFileSystem();
4444
if (FlutterPostSubmitFileComparator.isForEnvironment(platform)) {
45-
goldenFileComparator = await FlutterPostSubmitFileComparator.fromDefaultComparator(platform, namePrefix: namePrefix, log: print, fs: fs);
45+
goldenFileComparator = await FlutterPostSubmitFileComparator.fromDefaultComparator(
46+
platform,
47+
namePrefix: namePrefix,
48+
log: print,
49+
fs: fs,
50+
);
4651
} else if (FlutterPreSubmitFileComparator.isForEnvironment(platform)) {
47-
goldenFileComparator = await FlutterPreSubmitFileComparator.fromDefaultComparator(platform, namePrefix: namePrefix, log: print, fs: fs);
52+
goldenFileComparator = await FlutterPreSubmitFileComparator.fromDefaultComparator(
53+
platform,
54+
namePrefix: namePrefix,
55+
log: print,
56+
fs: fs,
57+
);
4858
} else if (FlutterSkippingFileComparator.isForEnvironment(platform)) {
4959
goldenFileComparator = FlutterSkippingFileComparator.fromDefaultComparator(
5060
'Golden file testing is not executed on Cirrus, or LUCI environments '
@@ -55,7 +65,11 @@ Future<void> testExecutable(FutureOr<void> Function() testMain, {String? namePre
5565
fs: fs,
5666
);
5767
} else {
58-
goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(platform, log: print, fs: fs);
68+
goldenFileComparator = await FlutterLocalFileComparator.fromDefaultComparator(
69+
platform,
70+
log: print,
71+
fs: fs,
72+
);
5973
}
6074
await testMain();
6175
}
@@ -251,7 +265,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
251265
required LogCallback log,
252266
required FileSystem fs,
253267
}) async {
254-
255268
defaultComparator ??= goldenFileComparator as LocalFileComparator;
256269
final Directory baseDirectory = FlutterGoldenFileComparator.getBaseDirectory(
257270
defaultComparator,
@@ -263,7 +276,13 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
263276

264277
goldens ??= SkiaGoldClient(baseDirectory, log: log);
265278
await goldens.auth();
266-
return FlutterPostSubmitFileComparator(baseDirectory.uri, goldens, namePrefix: namePrefix, log: log, fs: fs);
279+
return FlutterPostSubmitFileComparator(
280+
baseDirectory.uri,
281+
goldens,
282+
namePrefix: namePrefix,
283+
log: log,
284+
fs: fs,
285+
);
267286
}
268287

269288
@override
@@ -272,7 +291,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
272291
golden = _addPrefix(golden);
273292
await update(golden, imageBytes);
274293
final File goldenFile = getGoldenFile(golden);
275-
276294
return skiaClient.imgtestAdd(golden.path, goldenFile);
277295
}
278296

@@ -285,7 +303,6 @@ class FlutterPostSubmitFileComparator extends FlutterGoldenFileComparator {
285303
&& !platform.environment.containsKey('GOLD_TRYJOB')
286304
// Only run on main branch.
287305
&& _isMainBranch(platform.environment['GIT_BRANCH']);
288-
289306
return luciPostSubmit;
290307
}
291308
}
@@ -333,7 +350,6 @@ class FlutterPreSubmitFileComparator extends FlutterGoldenFileComparator {
333350
required LogCallback log,
334351
required FileSystem fs,
335352
}) async {
336-
337353
defaultComparator ??= goldenFileComparator as LocalFileComparator;
338354
final Directory baseDirectory = testBasedir ?? FlutterGoldenFileComparator.getBaseDirectory(
339355
defaultComparator,
@@ -427,7 +443,14 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator {
427443
defaultComparator ??= goldenFileComparator as LocalFileComparator;
428444
final Uri basedir = defaultComparator.basedir;
429445
final SkiaGoldClient skiaClient = SkiaGoldClient(fs.directory(basedir), log: log);
430-
return FlutterSkippingFileComparator(basedir, skiaClient, reason, namePrefix: namePrefix, log: log, fs: fs);
446+
return FlutterSkippingFileComparator(
447+
basedir,
448+
skiaClient,
449+
reason,
450+
namePrefix: namePrefix,
451+
log: log,
452+
fs: fs,
453+
);
431454
}
432455

433456
@override
@@ -549,7 +572,12 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
549572
);
550573
}
551574

552-
return FlutterLocalFileComparator(baseDirectory.uri, goldens, log: log, fs: fs);
575+
return FlutterLocalFileComparator(
576+
baseDirectory.uri,
577+
goldens,
578+
log: log,
579+
fs: fs,
580+
);
553581
}
554582

555583
@override

0 commit comments

Comments
 (0)