Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
This commit is contained in:
@@ -4,4 +4,6 @@
|
||||
|
||||
import 'package:flutter_tools/executable.dart' as executable;
|
||||
|
||||
main(List<String> args) => executable.main(args);
|
||||
void main(List<String> args) {
|
||||
executable.main(args);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class AdbDevice {
|
||||
/// Device model; can be null. `XT1045`, `Nexus_7`
|
||||
String get modelID => _info['model'];
|
||||
|
||||
set modelID(String value) {
|
||||
void set modelID(String value) {
|
||||
_info['model'] = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -288,6 +288,7 @@ analyzer:
|
||||
todo: ignore
|
||||
linter:
|
||||
rules:
|
||||
- always_declare_return_types
|
||||
# we'll turn on avoid_as as soon as it doesn't complain about "as dynamic"
|
||||
# - avoid_as
|
||||
- camel_case_types
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
import 'package:flutter_tools/src/android/adb.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
Adb adb = new Adb('adb');
|
||||
|
||||
// We only test the [Adb] class is we're able to locate the adb binary.
|
||||
|
||||
@@ -14,9 +14,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
AnalysisServer server;
|
||||
Directory tempDir;
|
||||
|
||||
|
||||
@@ -7,9 +7,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('android_device', () {
|
||||
testUsingContext('stores the requested id', () {
|
||||
String deviceId = '1234';
|
||||
|
||||
@@ -7,9 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_tools/src/base/utils.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('ItemListNotifier', () {
|
||||
test('sends notifications', () async {
|
||||
ItemListNotifier<String> list = new ItemListNotifier<String>();
|
||||
|
||||
@@ -7,9 +7,7 @@ import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/globals.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('DeviceManager', () {
|
||||
test('error', () async {
|
||||
AppContext context = new AppContext();
|
||||
|
||||
@@ -13,9 +13,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('create', () {
|
||||
Directory temp;
|
||||
|
||||
|
||||
@@ -17,9 +17,7 @@ import 'package:test/test.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
Daemon daemon;
|
||||
AppContext appContext;
|
||||
NotifyingLogger notifyingLogger;
|
||||
|
||||
@@ -7,9 +7,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('DeviceManager', () {
|
||||
testUsingContext('getDevices', () async {
|
||||
// Test that DeviceManager.getDevices() doesn't throw.
|
||||
|
||||
@@ -10,9 +10,7 @@ import 'package:test/test.dart';
|
||||
import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('devices', () {
|
||||
testUsingContext('returns 0 when called', () {
|
||||
DevicesCommand command = new DevicesCommand();
|
||||
|
||||
@@ -20,9 +20,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('drive', () {
|
||||
DriveCommand command;
|
||||
Device mockDevice;
|
||||
@@ -182,7 +180,7 @@ defineTests() {
|
||||
});
|
||||
|
||||
group('findTargetDevice on iOS', () {
|
||||
setOs() {
|
||||
void setOs() {
|
||||
when(os.isMacOS).thenReturn(true);
|
||||
when(os.isLinux).thenReturn(false);
|
||||
}
|
||||
@@ -222,7 +220,7 @@ defineTests() {
|
||||
});
|
||||
|
||||
group('findTargetDevice on Linux', () {
|
||||
setOs() {
|
||||
void setOs() {
|
||||
when(os.isMacOS).thenReturn(false);
|
||||
when(os.isLinux).thenReturn(true);
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('install', () {
|
||||
testUsingContext('returns 0 when Android is connected and ready for an install', () {
|
||||
InstallCommand command = new InstallCommand();
|
||||
|
||||
@@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('listen', () {
|
||||
testUsingContext('returns 1 when no device is connected', () {
|
||||
ListenCommand command = new ListenCommand(singleRun: true);
|
||||
|
||||
@@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('logs', () {
|
||||
testUsingContext('fail with a bad device id', () {
|
||||
LogsCommand command = new LogsCommand();
|
||||
|
||||
@@ -8,9 +8,7 @@ import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('OperatingSystemUtils', () {
|
||||
Directory temp;
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('run', () {
|
||||
testUsingContext('fails when target not found', () {
|
||||
RunCommand command = new RunCommand();
|
||||
|
||||
@@ -9,9 +9,7 @@ import 'package:flutter_tools/src/service_protocol.dart';
|
||||
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('service_protocol', () {
|
||||
test('Discovery Heartbeat', () async {
|
||||
MockDeviceLogReader logReader = new MockDeviceLogReader();
|
||||
|
||||
@@ -12,9 +12,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('stop', () {
|
||||
testUsingContext('returns 0 when Android is connected and ready to be stopped', () {
|
||||
StopCommand command = new StopCommand();
|
||||
|
||||
@@ -9,9 +9,7 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
import 'src/mocks.dart';
|
||||
|
||||
main() => defineTests();
|
||||
|
||||
defineTests() {
|
||||
void main() {
|
||||
group('trace', () {
|
||||
testUsingContext('returns 1 when no Android device is connected', () {
|
||||
TraceCommand command = new TraceCommand();
|
||||
|
||||
Reference in New Issue
Block a user