Enable avoid_redundant_argument_values lint (#91409)
This commit is contained in:
@@ -239,7 +239,6 @@ final ArgParser _argParser = ArgParser()
|
||||
..addMultiOption(
|
||||
'task',
|
||||
abbr: 't',
|
||||
splitCommas: true,
|
||||
help: 'Either:\n'
|
||||
' - the name of a task defined in manifest.yaml.\n'
|
||||
' Example: complex_layout__start_up.\n'
|
||||
@@ -362,13 +361,10 @@ final ArgParser _argParser = ArgParser()
|
||||
)
|
||||
..addFlag(
|
||||
'silent',
|
||||
negatable: true,
|
||||
defaultsTo: false,
|
||||
)
|
||||
..addMultiOption(
|
||||
'test',
|
||||
hide: true,
|
||||
splitCommas: true,
|
||||
callback: (List<String> value) {
|
||||
if (value.isNotEmpty) {
|
||||
throw const FormatException(
|
||||
|
||||
@@ -13,7 +13,5 @@ Future<void> main() async {
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
'test_driver/animated_image.dart',
|
||||
'animated_image',
|
||||
measureCpuGpu: true,
|
||||
measureMemory: true,
|
||||
).run);
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutScrollPerfTest(measureCpuGpu: true));
|
||||
await task(createComplexLayoutScrollPerfTest());
|
||||
}
|
||||
|
||||
@@ -115,7 +115,6 @@ Future<void> main() async {
|
||||
'list',
|
||||
'runtimes',
|
||||
],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
@@ -166,7 +165,6 @@ Future<void> main() async {
|
||||
'com.apple.CoreSimulator.SimDeviceType.iPhone-11',
|
||||
iOSSimRuntime,
|
||||
],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
@@ -180,7 +178,6 @@ Future<void> main() async {
|
||||
'com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm',
|
||||
watchSimRuntime,
|
||||
],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
@@ -188,7 +185,6 @@ Future<void> main() async {
|
||||
await eval(
|
||||
'xcrun',
|
||||
<String>['simctl', 'pair', watchDeviceID, phoneDeviceID],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
@@ -196,13 +192,11 @@ Future<void> main() async {
|
||||
await eval(
|
||||
'xcrun',
|
||||
<String>['simctl', 'bootstatus', phoneDeviceID, '-b'],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
await eval(
|
||||
'xcrun',
|
||||
<String>['simctl', 'bootstatus', watchDeviceID, '-b'],
|
||||
canFail: false,
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ Future<void> main() async {
|
||||
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
|
||||
'test_driver/large_image_changer.dart',
|
||||
'large_image_changer',
|
||||
measureCpuGpu: true,
|
||||
measureMemory: true,
|
||||
// This benchmark doesn't care about frame times, frame times will be heavily
|
||||
// impacted by IO time for loading the image initially.
|
||||
benchmarkScoreKeys: <String>[
|
||||
|
||||
@@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPostBackdropFilterPerfTest(measureCpuGpu: true));
|
||||
await task(createPostBackdropFilterPerfTest());
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ void main() {
|
||||
'/smuggle-it',
|
||||
'lib/route.dart',
|
||||
],
|
||||
canFail: false,
|
||||
);
|
||||
});
|
||||
section('TEST WHETHER `flutter run --route` WORKS');
|
||||
|
||||
@@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createSimpleAnimationPerfTest(measureCpuGpu: true));
|
||||
await task(createSimpleAnimationPerfTest());
|
||||
}
|
||||
|
||||
@@ -49,8 +49,6 @@ class TestCommand extends Command<void> {
|
||||
'task, will write test results to the file.');
|
||||
argParser.addFlag(
|
||||
'silent',
|
||||
negatable: true,
|
||||
defaultsTo: false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
|
||||
@override
|
||||
Future<List<String>> discoverDevices() async {
|
||||
final List<String> output = (await eval(adbPath, <String>['devices', '-l'], canFail: false))
|
||||
final List<String> output = (await eval(adbPath, <String>['devices', '-l']))
|
||||
.trim().split('\n');
|
||||
final List<String> results = <String>[];
|
||||
for (final String line in output) {
|
||||
@@ -327,7 +327,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
// Restarting `adb` helps with keeping device connections alive. When `adb`
|
||||
// runs non-stop for too long it loses connections to devices. There may be
|
||||
// a better method, but so far that's the best one I've found.
|
||||
await exec(adbPath, <String>['kill-server'], canFail: false);
|
||||
await exec(adbPath, <String>['kill-server']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,7 +555,6 @@ class AndroidDevice extends Device {
|
||||
adbPath,
|
||||
<String>['-s', deviceId, ...arguments],
|
||||
environment: environment,
|
||||
canFail: false,
|
||||
printStdout: !silent,
|
||||
printStderr: !silent,
|
||||
);
|
||||
|
||||
@@ -224,7 +224,7 @@ Future<String> getDartVersion() async {
|
||||
|
||||
Future<String?> getCurrentFlutterRepoCommit() {
|
||||
if (!dir('${flutterDirectory.path}/.git').existsSync()) {
|
||||
return Future<String?>.value(null);
|
||||
return Future<String?>.value();
|
||||
}
|
||||
|
||||
return inDirectory<String>(flutterDirectory, () {
|
||||
|
||||
@@ -145,7 +145,6 @@ class PluginPlatformInterfaceMacOS {
|
||||
final Process run = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
flutterCommandArgs('run', <String>['-d', 'macos', '-v']),
|
||||
environment: null,
|
||||
);
|
||||
Completer<void> registryExecutedCompleter = Completer<void>();
|
||||
final StreamSubscription<void> subscription = run.stdout
|
||||
|
||||
@@ -133,8 +133,6 @@ Future<TaskResult> runWebBenchmark({ required bool useCanvasKit }) async {
|
||||
final ChromeOptions options = ChromeOptions(
|
||||
url: 'http://localhost:$benchmarkServerPort/index.html',
|
||||
userDataDirectory: userDataDir,
|
||||
windowHeight: 1024,
|
||||
windowWidth: 1024,
|
||||
headless: isUncalibratedSmokeTest,
|
||||
debugPort: chromeDebugPort,
|
||||
);
|
||||
|
||||
@@ -27,8 +27,8 @@ void main() {
|
||||
final AndroidDevice androidDevice = device as AndroidDevice;
|
||||
expect(await androidDevice.isArm64(), isTrue);
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.product.cpu.abi'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.product.cpu.abi']),
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -51,7 +51,7 @@ void main() {
|
||||
test('sends power event', () async {
|
||||
await device.togglePower();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'input', arguments: <String>['keyevent', '26']),
|
||||
]);
|
||||
});
|
||||
@@ -62,7 +62,7 @@ void main() {
|
||||
FakeDevice.pretendAwake();
|
||||
await device.wakeUp();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'dumpsys', arguments: <String>['power']),
|
||||
]);
|
||||
});
|
||||
@@ -71,7 +71,7 @@ void main() {
|
||||
FakeDevice.pretendAsleep();
|
||||
await device.wakeUp();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'dumpsys', arguments: <String>['power']),
|
||||
cmd(command: 'input', arguments: <String>['keyevent', '26']),
|
||||
]);
|
||||
@@ -83,7 +83,7 @@ void main() {
|
||||
FakeDevice.pretendAsleep();
|
||||
await device.sendToSleep();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'dumpsys', arguments: <String>['power']),
|
||||
]);
|
||||
});
|
||||
@@ -92,7 +92,7 @@ void main() {
|
||||
FakeDevice.pretendAwake();
|
||||
await device.sendToSleep();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'dumpsys', arguments: <String>['power']),
|
||||
cmd(command: 'input', arguments: <String>['keyevent', '26']),
|
||||
]);
|
||||
@@ -104,7 +104,7 @@ void main() {
|
||||
FakeDevice.pretendAwake();
|
||||
await device.unlock();
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'dumpsys', arguments: <String>['power']),
|
||||
cmd(command: 'input', arguments: <String>['keyevent', '82']),
|
||||
]);
|
||||
@@ -115,7 +115,7 @@ void main() {
|
||||
test('tap', () async {
|
||||
await device.tap(100, 200);
|
||||
expectLog(<CommandArgs>[
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
|
||||
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
|
||||
cmd(command: 'input', arguments: <String>['tap', '100', '200']),
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ Sat Mar 9 20:13:00 2019 49 /usr/sbin/syslogd
|
||||
),
|
||||
RunningProcessInfo(
|
||||
'49',
|
||||
DateTime(2019, 3, 9, 20, 13, 00),
|
||||
DateTime(2019, 3, 9, 20, 13),
|
||||
'/usr/sbin/syslogd',
|
||||
),
|
||||
]));
|
||||
|
||||
Reference in New Issue
Block a user