apply lint prefer_void_to_null in dev/ (#22661)

This commit is contained in:
Alexandre Ardhuin
2018-10-04 18:44:23 +02:00
committed by GitHub
parent 89c5ace117
commit d340e2f229
107 changed files with 210 additions and 212 deletions

View File

@@ -43,8 +43,8 @@ TaskFunction createHotModeTest() {
environment: null
);
final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>();
final Completer<void> stdoutDone = Completer<void>();
final Completer<void> stderrDone = Completer<void>();
process.stdout
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
@@ -80,8 +80,8 @@ TaskFunction createHotModeTest() {
stderrDone.complete();
});
await Future.wait<Null>(
<Future<Null>>[stdoutDone.future, stderrDone.future]);
await Future.wait<void>(
<Future<void>>[stdoutDone.future, stderrDone.future]);
await process.exitCode;
twoReloadsData = json.decode(benchmarkFile.readAsStringSync());
@@ -96,8 +96,8 @@ TaskFunction createHotModeTest() {
<String>['run']..addAll(options),
environment: null
);
final Completer<Null> stdoutDone = Completer<Null>();
final Completer<Null> stderrDone = Completer<Null>();
final Completer<void> stdoutDone = Completer<void>();
final Completer<void> stderrDone = Completer<void>();
process.stdout
.transform<String>(utf8.decoder)
.transform<String>(const LineSplitter())
@@ -118,8 +118,8 @@ TaskFunction createHotModeTest() {
stderrDone.complete();
});
await Future.wait<Null>(
<Future<Null>>[stdoutDone.future, stderrDone.future]);
await Future.wait<void>(
<Future<void>>[stdoutDone.future, stderrDone.future]);
await process.exitCode;
freshRestartReloadsData =

View File

@@ -73,7 +73,7 @@ class FlutterProject {
String get rootPath => path.join(parent.path, name);
Future<Null> addPlugin(String plugin) async {
Future<void> addPlugin(String plugin) async {
final File pubspec = File(path.join(rootPath, 'pubspec.yaml'));
String content = await pubspec.readAsString();
content = content.replaceFirst(
@@ -83,13 +83,13 @@ class FlutterProject {
await pubspec.writeAsString(content, flush: true);
}
Future<Null> build(String target) async {
Future<void> build(String target) async {
await inDirectory(Directory(rootPath), () async {
await flutter('build', options: <String>[target]);
});
}
Future<Null> delete() async {
Future<void> delete() async {
if (Platform.isWindows) {
// A running Gradle daemon might prevent us from deleting the project
// folder on Windows.
@@ -99,7 +99,7 @@ class FlutterProject {
canFail: true,
);
// TODO(ianh): Investigating if flakiness is timing dependent.
await Future<Null>.delayed(const Duration(seconds: 10));
await Future<void>.delayed(const Duration(seconds: 10));
}
rmTree(parent);
}

View File

@@ -61,7 +61,7 @@ class Upload {
final HttpClientResponse response = await request.close().timeout(timeLimit);
if (response.statusCode == HttpStatus.ok) {
logMessage('Saved $name');
await response.drain<Null>();
await response.drain<void>();
} else {
// TODO(hansmuller): only retry on 5xx and 429 responses
logMessage('Request to save "$name" (length ${content.length}) failed with status ${response.statusCode}, will retry');
@@ -93,7 +93,7 @@ class Upload {
static bool isNotComplete(Upload upload) => !upload.isComplete;
}
Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
Future<void> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
assert(fromPaths.length == largeNames.length);
assert(fromPaths.length == smallNames.length);
@@ -113,7 +113,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
// If path is lib/foo.png then screenshotName is foo.
String screenshotName(String path) => basenameWithoutExtension(path);
Future<Null> saveCatalogScreenshots({
Future<void> saveCatalogScreenshots({
Directory directory, // Where the *.png screenshots are.
String commit, // The commit hash to be used as a cloud storage "directory".
String token, // Cloud storage authorization token.