Add spaces after flow control statements (#126320)

This commit is contained in:
Tomasz Gucio
2023-05-15 11:07:30 +02:00
committed by GitHub
parent 231e00d26b
commit 99c7e9f088
116 changed files with 264 additions and 174 deletions

View File

@@ -208,7 +208,7 @@ void main() {
try {
localFileSystem.systemTempDirectory;
fail('expected tool exit');
} on ToolExit catch(e) {
} on ToolExit catch (e) {
expect(e.message, 'Your system temp directory (/does_not_exist) does not exist. '
'Did you set an invalid override in your environment? '
'See issue https://github.com/flutter/flutter/issues/74042 for more context.'

View File

@@ -506,13 +506,13 @@ void main() {
final MemoryIOSink frontendServerStdIn = MemoryIOSink();
Stream<List<int>> frontendServerStdOut() async* {
int processed = 0;
while(true) {
while(frontendServerStdIn.writes.length == processed) {
while (true) {
while (frontendServerStdIn.writes.length == processed) {
await Future<dynamic>.delayed(const Duration(milliseconds: 5));
}
String? boundaryKey;
while(processed < frontendServerStdIn.writes.length) {
while (processed < frontendServerStdIn.writes.length) {
final List<int> data = frontendServerStdIn.writes[processed];
final String stringData = utf8.decode(data);
if (stringData.startsWith('compile ')) {

View File

@@ -1060,10 +1060,10 @@ dependencies:
const String newPluginName = 'flutterEngine.getPlugins().add(new plugin1.UseNewEmbedding());';
const String oldPluginName = 'abcplugin1.UseOldEmbedding.registerWith(shimPluginRegistry.registrarFor("abcplugin1.UseOldEmbedding"));';
final String content = registrant.readAsStringSync();
for(final String plugin in <String>[newPluginName,oldPluginName]) {
for (final String plugin in <String>[newPluginName,oldPluginName]) {
expect(content, contains(plugin));
expect(content.split(plugin).first.trim().endsWith('try {'), isTrue);
expect(content.split(plugin).last.trim().startsWith('} catch(Exception e) {'), isTrue);
expect(content.split(plugin).last.trim().startsWith('} catch (Exception e) {'), isTrue);
}
}, overrides: <Type, Generator>{
FileSystem: () => fs,

View File

@@ -75,7 +75,7 @@ void main() {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final int vmServicePort = await getFreePort();
int ddsPort = await getFreePort();
while(ddsPort == vmServicePort) {
while (ddsPort == vmServicePort) {
ddsPort = await getFreePort();
}
// If both --dds-port and --vm-service-port are provided, --dds-port will be used by

View File

@@ -357,11 +357,11 @@ PubspecEditor _setDartSDKVersionEditor(String version) {
for (i++; i < lines.length; i++) {
final String innerLine = lines[i];
final String sdkLine = " sdk: '$version'";
if(innerLine.isNotEmpty && !innerLine.startsWith(' ')) {
if (innerLine.isNotEmpty && !innerLine.startsWith(' ')) {
lines.insert(i, sdkLine);
break;
}
if(innerLine.startsWith(' sdk:')) {
if (innerLine.startsWith(' sdk:')) {
lines[i] = sdkLine;
break;
}

View File

@@ -130,7 +130,7 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
try {
await future;
fail('ToolExit expected, but nothing thrown');
} on ToolExit catch(e) {
} on ToolExit catch (e) {
expect(e.message, messageMatcher);
// Catch all exceptions to give a better test failure message.
} catch (e, trace) { // ignore: avoid_catches_without_on_clauses

View File

@@ -230,7 +230,7 @@ class FakePollingDeviceDiscovery extends PollingDeviceDiscovery {
}
void setDevices(List<Device> devices) {
while(_devices.isNotEmpty) {
while (_devices.isNotEmpty) {
_removeDevice(_devices.first);
}
devices.forEach(addDevice);