Skip to content

Commit

Permalink
enable lint avoid_void_async (flutter#21652)
Browse files Browse the repository at this point in the history
  • Loading branch information
a14n authored Sep 11, 2018
1 parent 98ad574 commit 774ca2f
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ linter:
- avoid_types_as_parameter_names
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
- avoid_unused_constructor_parameters
# - avoid_void_async # not yet tested
- avoid_void_async
- await_only_futures
- camel_case_types
- cancel_subscriptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/tasks/integration_tests.dart';

void main() async {
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.android;
await task(createAndroidSemanticsIntegrationTest());
}
2 changes: 1 addition & 1 deletion dev/devicelab/bin/tasks/gradle_plugin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Future<void> runPluginProjectTest(Future<void> testFunction(FlutterPluginProject
}
}

void main() async {
Future<void> main() async {
await task(() async {
section('Find Java');

Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/test/widgets/async_lifecycle_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class InvalidOnInitLifecycleWidget extends StatefulWidget {

class InvalidOnInitLifecycleWidgetState extends State<InvalidOnInitLifecycleWidget> {
@override
void initState() async {
Future<void> initState() async {
super.initState();
}

Expand All @@ -31,7 +31,7 @@ class InvalidDidUpdateWidgetLifecycleWidget extends StatefulWidget {

class InvalidDidUpdateWidgetLifecycleWidgetState extends State<InvalidDidUpdateWidgetLifecycleWidget> {
@override
void didUpdateWidget(InvalidDidUpdateWidgetLifecycleWidget oldWidget) async {
Future<void> didUpdateWidget(InvalidDidUpdateWidgetLifecycleWidget oldWidget) async {
super.didUpdateWidget(oldWidget);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'dart:async';

void main(FutureOr<void> testMain()) async {
Future<void> main(FutureOr<void> testMain()) async {
await runZoned<dynamic>(testMain, zoneValues: <Type, String>{
String: '/test_config',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'dart:async';

void main(FutureOr<void> testMain()) async {
Future<void> main(FutureOr<void> testMain()) async {
await runZoned<dynamic>(testMain, zoneValues: <Type, dynamic>{
String: '/test_config/nested_config',
int: 123,
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class ResidentCompiler {

final List<_CompilationRequest> _compilationQueue = <_CompilationRequest>[];

void _handleCompilationRequest(_CompilationRequest request) async {
Future<void> _handleCompilationRequest(_CompilationRequest request) async {
final bool isEmpty = _compilationQueue.isEmpty;
_compilationQueue.add(request);
// Only trigger processing if queue was empty - i.e. no other requests
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_tools/test/flutter_manifest_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ flutter:
});

group('FlutterManifest with MemoryFileSystem', () {
void assertSchemaIsReadable() async {
Future<void> assertSchemaIsReadable() async {
const String manifest = '''
name: test
dependencies:
Expand All @@ -529,18 +529,18 @@ flutter:
);
}

testUsingContext('Validate manifest on original fs', () async {
testUsingContext('Validate manifest on original fs', () {
assertSchemaIsReadable();
});

testUsingContextAndFs('Validate manifest on Posix FS',
new MemoryFileSystem(style: FileSystemStyle.posix), () async {
new MemoryFileSystem(style: FileSystemStyle.posix), () {
assertSchemaIsReadable();
}
);

testUsingContextAndFs('Validate manifest on Windows FS',
new MemoryFileSystem(style: FileSystemStyle.windows), () async {
new MemoryFileSystem(style: FileSystemStyle.windows), () {
assertSchemaIsReadable();
}
);
Expand Down

0 comments on commit 774ca2f

Please sign in to comment.