Enable unnecessary_await_in_return lint (#77434)

This commit is contained in:
Michael Goderbauer
2021-03-05 18:38:15 -08:00
committed by GitHub
parent 8a9042ba91
commit cb867bbedc
91 changed files with 183 additions and 183 deletions

View File

@@ -38,7 +38,7 @@ class NewGalleryWebCompileTest {
() async {
await flutter('doctor');
return await WebCompileTest.runSingleBuildTest(
return WebCompileTest.runSingleBuildTest(
directory: galleryDir.path,
metric: metricKeyPrefix,
measureBuildTime: true,

View File

@@ -33,6 +33,6 @@ Future<void> main() async {
});
final TaskFunction taskFunction = createPlatformViewStartupTest();
return await taskFunction();
return taskFunction();
});
}

View File

@@ -22,7 +22,7 @@ void main() {
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
section('TEST WHETHER `flutter drive --route` WORKS');
await inDirectory(appDir, () async {
return await flutter(
return flutter(
'drive',
options: <String>['--verbose', '-d', device.deviceId, '--route', '/smuggle-it', 'lib/route.dart'],
canFail: false,

View File

@@ -8,6 +8,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
/// Runs all Web benchmarks using the CanvasKit rendering backend.
Future<void> main() async {
await task(() async {
return await runWebBenchmark(useCanvasKit: true);
return runWebBenchmark(useCanvasKit: true);
});
}

View File

@@ -8,6 +8,6 @@ import 'package:flutter_devicelab/tasks/web_benchmarks.dart';
/// Runs all Web benchmarks using the HTML rendering backend.
Future<void> main() async {
await task(() async {
return await runWebBenchmark(useCanvasKit: false);
return runWebBenchmark(useCanvasKit: false);
});
}

View File

@@ -210,7 +210,7 @@ class ApkExtractor {
/// Gets the content of the `AndroidManifest.xml`.
Future<String> getAndroidManifest(String apk) async {
return await _evalApkAnalyzer(
return _evalApkAnalyzer(
<String>[
'manifest',
'print',

View File

@@ -750,7 +750,7 @@ Future<int> gitClone({String path, String repo}) async {
await Directory(path).create(recursive: true);
return await inDirectory<int>(
return inDirectory<int>(
path,
() => exec('git', <String>['clone', repo]),
);

View File

@@ -35,13 +35,13 @@ TaskFunction createMicrobenchmarkTask() {
device.deviceId,
];
options.add(benchmarkPath);
return await _startFlutter(
return _startFlutter(
options: options,
canFail: false,
);
});
return await _readJsonResults(flutterProcess);
return _readJsonResults(flutterProcess);
}
return _run();
}

View File

@@ -29,7 +29,7 @@ class NewGalleryPerfTest extends PerfTest {
// turns out to be updated frequently in the future, we can set up an auto
// roller to update this version.
await getNewGallery(galleryVersion, galleryDir);
return await super.run();
return super.run();
}
final Directory galleryDir;

View File

@@ -486,7 +486,7 @@ class StartupTest {
final bool reportMetrics;
Future<TaskResult> run() async {
return await inDirectory<TaskResult>(testDirectory, () async {
return inDirectory<TaskResult>(testDirectory, () async {
final Device device = await devices.workingDevice;
const int iterations = 5;
final List<Map<String, dynamic>> results = <Map<String, dynamic>>[];
@@ -995,7 +995,7 @@ class CompileTest {
final bool reportPackageContentSizes;
Future<TaskResult> run() async {
return await inDirectory<TaskResult>(testDirectory, () async {
return inDirectory<TaskResult>(testDirectory, () async {
final Device device = await devices.workingDevice;
await device.unlock();
await flutter('packages', options: <String>['get']);

View File

@@ -25,7 +25,7 @@ Future<TaskResult> runWebBenchmark({ @required bool useCanvasKit }) async {
// Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy.
Logger.root.level = Level.INFO;
final String macrobenchmarksDirectory = path.join(flutterDirectory.path, 'dev', 'benchmarks', 'macrobenchmarks');
return await inDirectory(macrobenchmarksDirectory, () async {
return inDirectory(macrobenchmarksDirectory, () async {
await evalFlutter('build', options: <String>[
'web',
'--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true',