Add missing trailing commas (#28673)
* add trailing commas on list/map/parameters * add trailing commas on Invocation with nb of arg>1 * add commas for widget containing widgets * add trailing commas if instantiation contains trailing comma * revert bad change
This commit is contained in:
committed by
GitHub
parent
046f960ae2
commit
387f885481
@@ -41,7 +41,7 @@ Future<TaskResult> createFlutterRunTask() async {
|
||||
startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
<String>['run']..addAll(options),
|
||||
environment: null
|
||||
environment: null,
|
||||
);
|
||||
final Completer<void> finished = Completer<void>();
|
||||
final StreamSubscription<void> subscription = device.logcat.listen((String line) {
|
||||
|
||||
@@ -276,7 +276,7 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
|
||||
'./gradlew',
|
||||
args,
|
||||
workingDirectory: workingDirectory,
|
||||
environment: <String, String>{ 'JAVA_HOME': javaHome }
|
||||
environment: <String, String>{ 'JAVA_HOME': javaHome },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Future<void> main() async {
|
||||
'--org',
|
||||
'io.flutter.devicelab',
|
||||
'--template=module',
|
||||
'hello'
|
||||
'hello',
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
final Map<String, dynamic> req = <String, dynamic>{
|
||||
'id': requestId,
|
||||
'method': method,
|
||||
'params': params
|
||||
'params': params,
|
||||
};
|
||||
final String jsonEncoded = json.encode(<Map<String, dynamic>>[req]);
|
||||
print('run:stdin: $jsonEncoded');
|
||||
|
||||
@@ -40,7 +40,7 @@ Future<void> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
final List<File> xcconfigFiles = <File>[
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig'))
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Release.xcconfig')),
|
||||
];
|
||||
|
||||
bool xcconfigFileExists = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ TaskFunction createHotModeTest() {
|
||||
final File benchmarkFile = file(path.join(_editedFlutterGalleryDir.path, 'hot_benchmark.json'));
|
||||
rm(benchmarkFile);
|
||||
final List<String> options = <String>[
|
||||
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident'
|
||||
'--hot', '-d', device.deviceId, '--benchmark', '--verbose', '--resident',
|
||||
];
|
||||
setLocalEngineOptionIfNecessary(options);
|
||||
int hotReloadCount = 0;
|
||||
@@ -40,7 +40,7 @@ TaskFunction createHotModeTest() {
|
||||
final Process process = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
<String>['run']..addAll(options),
|
||||
environment: null
|
||||
environment: null,
|
||||
);
|
||||
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
@@ -53,11 +53,11 @@ TaskFunction createHotModeTest() {
|
||||
if (hotReloadCount == 0) {
|
||||
// Update the file and reload again.
|
||||
final File appDartSource = file(path.join(
|
||||
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart'
|
||||
_editedFlutterGalleryDir.path, 'lib/gallery/app.dart',
|
||||
));
|
||||
appDartSource.writeAsStringSync(
|
||||
appDartSource.readAsStringSync().replaceFirst(
|
||||
"'Flutter Gallery'", "'Updated Flutter Gallery'"
|
||||
"'Flutter Gallery'", "'Updated Flutter Gallery'",
|
||||
)
|
||||
);
|
||||
process.stdin.writeln('r');
|
||||
@@ -94,7 +94,7 @@ TaskFunction createHotModeTest() {
|
||||
final Process process = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
<String>['run']..addAll(options),
|
||||
environment: null
|
||||
environment: null,
|
||||
);
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
@@ -156,7 +156,7 @@ TaskFunction createHotModeTest() {
|
||||
'hotReloadFlutterReassembleMillisecondsAfterChange',
|
||||
'hotReloadVMReloadMillisecondsAfterChange',
|
||||
'hotReloadInitialDevFSSyncAfterRelaunchMilliseconds',
|
||||
]
|
||||
],
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ TaskFunction createFlavorsTest() {
|
||||
return DriverTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/flavors',
|
||||
'lib/main.dart',
|
||||
extraOptions: <String>['--flavor', 'paid']
|
||||
extraOptions: <String>['--flavor', 'paid'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ TaskFunction createCodegenerationIntegrationTest() {
|
||||
'${flutterDirectory.path}/dev/integration_tests/codegen',
|
||||
'lib/main.dart',
|
||||
environment: <String, String>{
|
||||
'FLUTTER_EXPERIMENTAL_BUILD': 'true'
|
||||
'FLUTTER_EXPERIMENTAL_BUILD': 'true',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class FlutterProject {
|
||||
await inDirectory(directory, () async {
|
||||
await flutter(
|
||||
'create',
|
||||
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest')
|
||||
options: <String>['--template=app', '--org', 'io.flutter.devicelab']..addAll(options)..add('plugintest'),
|
||||
);
|
||||
});
|
||||
return FlutterProject(directory, 'plugintest');
|
||||
|
||||
@@ -80,7 +80,7 @@ tasks:
|
||||
tasks:
|
||||
- a
|
||||
- b
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -89,7 +89,7 @@ tasks:
|
||||
'''
|
||||
tasks:
|
||||
1: 2
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -98,7 +98,7 @@ tasks:
|
||||
'''
|
||||
tasks:
|
||||
foo: 2
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -108,7 +108,7 @@ tasks:
|
||||
tasks:
|
||||
foo:
|
||||
bar: 2
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -118,7 +118,7 @@ tasks:
|
||||
tasks:
|
||||
foo:
|
||||
required_agent_capabilities: 1
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -128,7 +128,7 @@ tasks:
|
||||
tasks:
|
||||
foo:
|
||||
required_agent_capabilities: [1]
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -138,7 +138,7 @@ tasks:
|
||||
tasks:
|
||||
foo:
|
||||
required_agent_capabilities: ["a"]
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -149,7 +149,7 @@ tasks:
|
||||
foo:
|
||||
description: b
|
||||
required_agent_capabilities: ["a"]
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -161,7 +161,7 @@ tasks:
|
||||
description: b
|
||||
stage: c
|
||||
required_agent_capabilities: []
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
testManifestError(
|
||||
@@ -174,7 +174,7 @@ tasks:
|
||||
stage: c
|
||||
required_agent_capabilities: ["a"]
|
||||
flaky: not-a-boolean
|
||||
'''
|
||||
''',
|
||||
);
|
||||
|
||||
test('accepts boolean flaky option', () {
|
||||
|
||||
Reference in New Issue
Block a user