Skip to content

Commit e5194da

Browse files
munificentCommit Queue
authored andcommitted
Reformat tools/ and utils/ using the 3.8 style.
Change-Id: I7b28583eb928f60a45d1f476194d197b4df88062 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425184 Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Nate Bosch <[email protected]>
1 parent fac5fec commit e5194da

File tree

4 files changed

+86
-86
lines changed

4 files changed

+86
-86
lines changed

tools/copy_dart_to_flutter.dart

Lines changed: 61 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -35,64 +35,58 @@ const _localFlutter = 'local-flutter';
3535
const _reset = 'reset';
3636
const _verbose = 'verbose';
3737

38-
final _parser =
39-
ArgParser()
40-
..addOption(
41-
_architecture,
42-
abbr: 'a',
43-
help: 'Specify your machine\'s architecture.',
44-
allowed: ['ARM64', 'X64'],
45-
defaultsTo: 'ARM64',
46-
)
47-
..addFlag(
48-
_buildSdk,
49-
negatable: true,
50-
defaultsTo: true,
51-
help:
52-
'Whether to build the Dart SDK as part of running this script. '
53-
'Negate with --no-$_buildSdk if you have already built the Dart '
54-
'SDK locally and want to skip this step.',
55-
)
56-
..addOption(
57-
_localDart,
58-
abbr: 'd',
59-
help:
60-
'Path to your local Dart SDK directory. If unspecified, this value '
61-
'will default to the value of the LOCAL_DART_SDK environment '
62-
'variable.',
63-
valueHelp: '/Users/me/path/to/dart-sdk/sdk',
64-
)
65-
..addOption(
66-
_localFlutter,
67-
abbr: 'f',
68-
help:
69-
'Path to your local Flutter SDK directory. If unspecified, this '
70-
'value will default to the value of the LOCAL_FLUTTER_SDK '
71-
'environment variable.',
72-
valueHelp: '/Users/me/path/to/flutter',
73-
)
74-
..addFlag(
75-
_verbose,
76-
negatable: false,
77-
abbr: 'v',
78-
help:
79-
'Run the script with verbose output, which will forward the stdout '
80-
'and stderr of all sub-processes.',
81-
)
82-
..addFlag(
83-
_help,
84-
negatable: false,
85-
abbr: 'h',
86-
help: 'Show the program usage.',
87-
)
88-
..addSeparator('Additional commands')
89-
..addFlag(
90-
_reset,
91-
negatable: false,
92-
help:
93-
'Reset your local Flutter SDK cache to undo the effects of running '
94-
'this script.',
95-
);
38+
final _parser = ArgParser()
39+
..addOption(
40+
_architecture,
41+
abbr: 'a',
42+
help: 'Specify your machine\'s architecture.',
43+
allowed: ['ARM64', 'X64'],
44+
defaultsTo: 'ARM64',
45+
)
46+
..addFlag(
47+
_buildSdk,
48+
negatable: true,
49+
defaultsTo: true,
50+
help: 'Whether to build the Dart SDK as part of running this script. '
51+
'Negate with --no-$_buildSdk if you have already built the Dart '
52+
'SDK locally and want to skip this step.',
53+
)
54+
..addOption(
55+
_localDart,
56+
abbr: 'd',
57+
help: 'Path to your local Dart SDK directory. If unspecified, this value '
58+
'will default to the value of the LOCAL_DART_SDK environment '
59+
'variable.',
60+
valueHelp: '/Users/me/path/to/dart-sdk/sdk',
61+
)
62+
..addOption(
63+
_localFlutter,
64+
abbr: 'f',
65+
help: 'Path to your local Flutter SDK directory. If unspecified, this '
66+
'value will default to the value of the LOCAL_FLUTTER_SDK '
67+
'environment variable.',
68+
valueHelp: '/Users/me/path/to/flutter',
69+
)
70+
..addFlag(
71+
_verbose,
72+
negatable: false,
73+
abbr: 'v',
74+
help: 'Run the script with verbose output, which will forward the stdout '
75+
'and stderr of all sub-processes.',
76+
)
77+
..addFlag(
78+
_help,
79+
negatable: false,
80+
abbr: 'h',
81+
help: 'Show the program usage.',
82+
)
83+
..addSeparator('Additional commands')
84+
..addFlag(
85+
_reset,
86+
negatable: false,
87+
help: 'Reset your local Flutter SDK cache to undo the effects of running '
88+
'this script.',
89+
);
9690

9791
void main(List<String> args) async {
9892
if (Platform.isWindows) {
@@ -115,8 +109,7 @@ void main(List<String> args) async {
115109

116110
var localDartSdk =
117111
options.option(_localDart) ?? Platform.environment['LOCAL_DART_SDK'];
118-
var localFlutterSdk =
119-
options.option(_localFlutter) ??
112+
var localFlutterSdk = options.option(_localFlutter) ??
120113
Platform.environment['LOCAL_FLUTTER_SDK'];
121114
if (localDartSdk == null || localFlutterSdk == null) {
122115
stderr.writeln(
@@ -131,10 +124,13 @@ void main(List<String> args) async {
131124

132125
if (options.flag(_buildSdk)) {
133126
stdout.writeln('Building the Dart SDK...');
134-
await _runCommand('./tools/build.py', [
135-
'-mrelease',
136-
'create_sdk',
137-
], workingDirectory: localDartSdk);
127+
await _runCommand(
128+
'./tools/build.py',
129+
[
130+
'-mrelease',
131+
'create_sdk',
132+
],
133+
workingDirectory: localDartSdk);
138134
}
139135

140136
await _deleteDartSdkInFlutterCache(localFlutterSdk);
@@ -184,8 +180,7 @@ void main(List<String> args) async {
184180
}
185181

186182
Future<void> _resetLocalFlutterSdk(ArgResults options) async {
187-
var localFlutterSdk =
188-
options.option(_localFlutter) ??
183+
var localFlutterSdk = options.option(_localFlutter) ??
189184
Platform.environment['LOCAL_FLUTTER_SDK'];
190185
if (localFlutterSdk == null) {
191186
stderr.writeln(

tools/find_builders.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ Future<void> main(List<String> args) async {
2727
for (final testName in testNames) ...await _testGetConfigurations(testName),
2828
});
2929
final configurationBuilders = await _configurationBuilders();
30-
final builders =
31-
_filterBuilders({
32-
for (final config in configurations) configurationBuilders[config]!,
33-
}).toList()
34-
..sort();
30+
final builders = _filterBuilders({
31+
for (final config in configurations) configurationBuilders[config]!,
32+
}).toList()
33+
..sort();
3534

3635
final gerritTryList = builders.map((b) => '$b-try').join(',');
3736
print('Cq-Include-Trybots: dart/try:$gerritTryList');
@@ -116,10 +115,11 @@ Stream<Map<String, dynamic>> _configurationDocuments() async* {
116115
Future<Map<String, String>> _configurationBuilders() async {
117116
return {
118117
await for (final document in _configurationDocuments())
119-
if (document case {
120-
'name': String fullName,
121-
'fields': {'builder': {'stringValue': String builder}},
122-
})
118+
if (document
119+
case {
120+
'name': String fullName,
121+
'fields': {'builder': {'stringValue': String builder}},
122+
})
123123
fullName.split('/').last: builder,
124124
};
125125
}

utils/bazel/kernel_worker.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ main(List<String> args, SendPort? sendPort) async {
2525
if (args.contains('--persistent_worker')) {
2626
if (args.length != 1) {
2727
throw new StateError(
28-
"unexpected args, expected only --persistent-worker but got: $args");
28+
"unexpected args, expected only --persistent-worker but got: $args",
29+
);
2930
}
3031
await new KernelWorker(sendPort: sendPort).run();
3132
} else {
@@ -43,10 +44,11 @@ class KernelWorker extends AsyncWorkerLoop {
4344
/// If [sendPort] is provided it is used for bazel worker communication
4445
/// instead of stdin/stdout.
4546
KernelWorker({SendPort? sendPort})
46-
: super(
47-
connection: sendPort == null
48-
? null
49-
: SendPortAsyncWorkerConnection(sendPort));
47+
: super(
48+
connection: sendPort == null
49+
? null
50+
: SendPortAsyncWorkerConnection(sendPort),
51+
);
5052

5153
Future<WorkResponse> performRequest(WorkRequest request) async {
5254
var outputBuffer = new StringBuffer();
@@ -65,11 +67,13 @@ class KernelWorker extends AsyncWorkerLoop {
6567
inputDigests[toUri(input.path)] = input.digest;
6668
}
6769

68-
var result = await computeKernel(request.arguments,
69-
isWorker: true,
70-
outputBuffer: outputBuffer,
71-
inputDigests: inputDigests,
72-
previousState: previousStateToPass);
70+
var result = await computeKernel(
71+
request.arguments,
72+
isWorker: true,
73+
outputBuffer: outputBuffer,
74+
inputDigests: inputDigests,
75+
previousState: previousStateToPass,
76+
);
7377
previousState = result.previousState;
7478
if (!result.succeeded) {
7579
response.exitCode = 15;

utils/compiler/create_snapshot_entry.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Future<String> getVersion(var rootPath, bool noGitHash) {
2727

2828
Future<String> getDart2jsSnapshotGenerationFile(var rootPath, bool noGitHash) {
2929
return getVersion(rootPath, noGitHash).then((version) {
30-
var snapshotGenerationText = """
30+
var snapshotGenerationText =
31+
"""
3132
import 'package:compiler/src/dart2js.dart' as dart2jsMain;
3233
3334
void main(List<String> arguments) {

0 commit comments

Comments
 (0)