Skip to content

Commit 0f709a0

Browse files
committed
chore(all): formatted dart files
1 parent 7195cab commit 0f709a0

File tree

458 files changed

+21821
-19061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

458 files changed

+21821
-19061
lines changed

actions/bin/launch_android_emulator.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ Future<void> _action() async {
2525
);
2626
final script = core.getRequiredInput('script');
2727

28-
final sdkManager = SdkManager(
29-
apiLevel: apiLevel,
30-
target: target,
31-
abi: abi,
32-
);
28+
final sdkManager = SdkManager(apiLevel: apiLevel, target: target, abi: abi);
3329
final avdManager = AvdManager(
3430
apiLevel: apiLevel,
3531
target: target,
@@ -39,8 +35,5 @@ Future<void> _action() async {
3935

4036
await sdkManager.ensureSdk();
4137
await avdManager.launchEmulator();
42-
await core.withGroup(
43-
'Running script',
44-
() => ShellScript(script).run(),
45-
);
38+
await core.withGroup('Running script', () => ShellScript(script).run());
4639
}

actions/bin/launch_ios_simulator.dart

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,31 @@ Future<void> launch() async {
3030
core.info('No runtime found for $iosVersion');
3131
await installRuntime(iosVersion);
3232
}
33-
runtimeIdentifier = await core.withGroup(
34-
'Get runtime ID',
35-
() async {
36-
final runtimeId = await getRuntimeId(iosVersion);
37-
core.info('Found runtime ID: $runtimeId');
38-
return runtimeId;
39-
},
40-
);
33+
runtimeIdentifier = await core.withGroup('Get runtime ID', () async {
34+
final runtimeId = await getRuntimeId(iosVersion);
35+
core.info('Found runtime ID: $runtimeId');
36+
return runtimeId;
37+
});
4138
if (runtimeIdentifier == null) {
4239
throw Exception('Runtime not found after install');
4340
}
4441

4542
final createRes = await core.withGroup(
4643
'Create simulator',
47-
() => exec.exec(
48-
'xcrun',
49-
[
50-
'simctl',
51-
'create',
52-
'test',
53-
'iPhone 11',
54-
runtimeIdentifier!,
55-
],
56-
),
44+
() => exec.exec('xcrun', [
45+
'simctl',
46+
'create',
47+
'test',
48+
'iPhone 11',
49+
runtimeIdentifier!,
50+
]),
5751
);
5852
if (createRes.exitCode != 0) {
5953
throw Exception('Could not create simulator');
6054
}
6155
final bootRes = await core.withGroup(
6256
'Boot simulator',
63-
() => exec.exec(
64-
'xcrun',
65-
['simctl', 'boot', 'test'],
66-
),
57+
() => exec.exec('xcrun', ['simctl', 'boot', 'test']),
6758
);
6859
if (bootRes.exitCode != 0) {
6960
throw Exception('Could not boot simulator');
@@ -72,11 +63,12 @@ Future<void> launch() async {
7263

7364
/// Gets the iOS runtime identifier for the given [iosVersion].
7465
Future<String?> getRuntimeId(String iosVersion) async {
75-
final runtimesRes = await exec.exec(
76-
'xcrun',
77-
['simctl', 'list', 'runtimes', '-j'],
78-
echoOutput: false,
79-
);
66+
final runtimesRes = await exec.exec('xcrun', [
67+
'simctl',
68+
'list',
69+
'runtimes',
70+
'-j',
71+
], echoOutput: false);
8072
if (runtimesRes.exitCode != 0) {
8173
throw Exception('Could not list runtimes');
8274
}
@@ -95,18 +87,21 @@ Future<String?> getRuntimeId(String iosVersion) async {
9587
/// Installs the `xcodes` tool (https://github.com/XcodesOrg/xcodes) and
9688
/// `aria2` for speeding up downloads (as recommended by `xcodes`).
9789
Future<void> installXcodes() => core.withGroup('Install xcodes', () async {
98-
final res = await exec.exec(
99-
'brew',
100-
['install', 'xcodesorg/made/xcodes', 'aria2'],
101-
);
102-
if (res.exitCode != 0) {
103-
throw Exception('Could not install xcodes');
104-
}
105-
});
90+
final res = await exec.exec('brew', [
91+
'install',
92+
'xcodesorg/made/xcodes',
93+
'aria2',
94+
]);
95+
if (res.exitCode != 0) {
96+
throw Exception('Could not install xcodes');
97+
}
98+
});
10699

107100
Future<String> getLatest() async {
108-
final version = await exec
109-
.exec('/bin/sh', ['-c', r'xcodes runtimes | grep -e "iOS" | tail -n 1']);
101+
final version = await exec.exec('/bin/sh', [
102+
'-c',
103+
r'xcodes runtimes | grep -e "iOS" | tail -n 1',
104+
]);
110105
if (version.exitCode != 0) {
111106
throw Exception('Could not get latest version');
112107
}
@@ -117,16 +112,13 @@ Future<String> getLatest() async {
117112
/// Installs the iOS runtime for the given [iosVersion].
118113
Future<void> installRuntime(String iosVersion) async {
119114
await core.withGroup('Install runtime', () async {
120-
final res = await exec.exec(
121-
'sudo',
122-
[
123-
'xcodes',
124-
'runtimes',
125-
'install',
126-
iosVersion,
127-
'--no-color',
128-
],
129-
);
115+
final res = await exec.exec('sudo', [
116+
'xcodes',
117+
'runtimes',
118+
'install',
119+
iosVersion,
120+
'--no-color',
121+
]);
130122
if (res.exitCode != 0) {
131123
throw Exception('Could not install runtime');
132124
}

actions/bin/log_cw_metric.dart

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ Future<void> logMetric() async {
9494
'pub_server',
9595
];
9696

97-
final category = categories.firstWhereOrNull(
98-
workingDirectory.contains,
99-
);
97+
final category = categories.firstWhereOrNull(workingDirectory.contains);
10098

10199
if (category == null) {
102100
throw Exception(
@@ -112,16 +110,24 @@ Future<void> logMetric() async {
112110
'framework input of $framework must be one of: dart, flutter',
113111
);
114112
}
115-
final flutterDartChannel =
116-
core.getInput('flutter-dart-channel', defaultValue: defaultValue);
113+
final flutterDartChannel = core.getInput(
114+
'flutter-dart-channel',
115+
defaultValue: defaultValue,
116+
);
117117
final dartVersion = core.getInput('dart-version', defaultValue: defaultValue);
118-
final flutterVersion =
119-
core.getInput('flutter-version', defaultValue: defaultValue);
120-
final dartCompiler =
121-
core.getInput('dart-compiler', defaultValue: defaultValue);
118+
final flutterVersion = core.getInput(
119+
'flutter-version',
120+
defaultValue: defaultValue,
121+
);
122+
final dartCompiler = core.getInput(
123+
'dart-compiler',
124+
defaultValue: defaultValue,
125+
);
122126
final platform = core.getInput('platform', defaultValue: defaultValue);
123-
final platformVersion =
124-
core.getInput('platform-version', defaultValue: defaultValue);
127+
final platformVersion = core.getInput(
128+
'platform-version',
129+
defaultValue: defaultValue,
130+
);
125131

126132
final value = isFailed ? '1' : '0';
127133

@@ -140,8 +146,9 @@ Future<void> logMetric() async {
140146
//if (failingStep.isNotEmpty) 'failing-step': failingStep,
141147
};
142148

143-
final dimensionString =
144-
dimensions.entries.map((e) => '${e.key}=${e.value}').join(',');
149+
final dimensionString = dimensions.entries
150+
.map((e) => '${e.key}=${e.value}')
151+
.join(',');
145152

146153
final cloudArgs = <String>[
147154
'cloudwatch',
@@ -156,9 +163,7 @@ Future<void> logMetric() async {
156163
dimensionString,
157164
];
158165

159-
await processManager.run(
160-
<String>['aws', ...cloudArgs],
161-
);
166+
await processManager.run(<String>['aws', ...cloudArgs]);
162167

163168
core.info('Sent cloudwatch metric with args: $cloudArgs');
164169
}
@@ -193,9 +198,11 @@ Future<String> getFailingStep(
193198
final jobsList = GithubJobsList.fromJson(response);
194199
final matchingJob = jobsList.jobs.firstWhere(
195200
(job) => job.name.toLowerCase().contains(jobIdentifier),
196-
orElse: () => throw Exception(
197-
'No job found matching <$jobIdentifier>. Ensure full workflow path run name is unique. Available jobs: ${jobsList.jobs.map((e) => e.name).join(', ')}. Note that the "jobIdentifier" used to find the proper job uses the job id and not the job name, setting the "name" field in the workflow yaml will break this logic. See comments for more context.',
198-
),
201+
orElse:
202+
() =>
203+
throw Exception(
204+
'No job found matching <$jobIdentifier>. Ensure full workflow path run name is unique. Available jobs: ${jobsList.jobs.map((e) => e.name).join(', ')}. Note that the "jobIdentifier" used to find the proper job uses the job id and not the job name, setting the "name" field in the workflow yaml will break this logic. See comments for more context.',
205+
),
199206
);
200207
final steps = matchingJob.steps;
201208

actions/bin/setup_chromedriver.dart

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ Future<void> _installChromedriver() async {
1919
OS.linux => 'google-chrome',
2020
};
2121

22-
final versionResult = await processManager.run(
23-
<String>[chromeExecutable, '--version'],
24-
echoOutput: true,
25-
);
26-
final ProcessResult(
27-
:exitCode,
28-
:stdout as String,
29-
:stderr as String,
30-
) = versionResult;
22+
final versionResult = await processManager.run(<String>[
23+
chromeExecutable,
24+
'--version',
25+
], echoOutput: true);
26+
final ProcessResult(:exitCode, :stdout as String, :stderr as String) =
27+
versionResult;
3128
if (exitCode != 0) {
3229
throw Exception(stderr);
3330
}
@@ -46,26 +43,23 @@ Future<void> _installChromedriver() async {
4643
}
4744

4845
core.info('ChromeDriver not found in cache.');
49-
final chromeDriverUrl = await core.withGroup(
50-
'Get ChromeDriver URL',
51-
() async {
52-
core.info('Getting URL for ChromeDriver $chromeVersion');
46+
final chromeDriverUrl = await core.withGroup('Get ChromeDriver URL', () async {
47+
core.info('Getting URL for ChromeDriver $chromeVersion');
5348

54-
// ChromeDriver publishes the latest versions by platform here.
55-
// See: https://chromedriver.chromium.org/downloads
56-
final allChromeDownloadsJson = await HttpClient().getJson(
57-
'https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json',
58-
);
59-
core.debug('Got JSON: $allChromeDownloadsJson');
60-
final allChromeDownloads = AllChromeDownloads.fromJson(
61-
allChromeDownloadsJson,
62-
);
63-
return allChromeDownloads.chromeDriverUrl(
64-
chromeVersion,
65-
ChromePlatform.fromOsArch(process.platform, process.arch),
66-
);
67-
},
68-
);
49+
// ChromeDriver publishes the latest versions by platform here.
50+
// See: https://chromedriver.chromium.org/downloads
51+
final allChromeDownloadsJson = await HttpClient().getJson(
52+
'https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json',
53+
);
54+
core.debug('Got JSON: $allChromeDownloadsJson');
55+
final allChromeDownloads = AllChromeDownloads.fromJson(
56+
allChromeDownloadsJson,
57+
);
58+
return allChromeDownloads.chromeDriverUrl(
59+
chromeVersion,
60+
ChromePlatform.fromOsArch(process.platform, process.arch),
61+
);
62+
});
6963

7064
final installPath = await core.withGroup('Download ChromeDriver', () async {
7165
core.info('Downloading ChromeDriver: $chromeDriverUrl');
@@ -76,11 +70,7 @@ Future<void> _installChromedriver() async {
7670
final extractPath = await toolCache.extractZip(downloadPath);
7771
core.info('Extracted ChromeDriver to: $extractPath');
7872

79-
return toolCache.cacheDir(
80-
extractPath,
81-
_binaryName,
82-
chromeVersion,
83-
);
73+
return toolCache.cacheDir(extractPath, _binaryName, chromeVersion);
8474
});
8575

8676
core

actions/lib/src/action_context.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ final class ActionContext implements RunContext, PostRunContext {
4343

4444
@override
4545
Map<String, String> get stateValues => Map.fromEntries(
46-
process.env.entries.where((e) => e.key.startsWith('STATE_')).cast(),
47-
);
46+
process.env.entries.where((e) => e.key.startsWith('STATE_')).cast(),
47+
);
4848

4949
@override
5050
String? getState(String name) {

actions/lib/src/android/android_tool.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ final class AndroidTool {
3636
);
3737
final ProcessResult(:exitCode, :stdout, :stderr) = result;
3838
if (exitCode != 0 && failOnNonZeroExit) {
39-
throw ProcessException(
40-
exe,
41-
args,
42-
'$stdout\n$stderr',
43-
exitCode,
44-
);
39+
throw ProcessException(exe, args, '$stdout\n$stderr', exitCode);
4540
}
4641
return result;
4742
}

0 commit comments

Comments
 (0)