enable pkg:pedantic lints (#108)
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 2b0a49b..bfdbb7c 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,3 +1,4 @@
+include: package:pedantic/analysis_options.yaml
linter:
rules:
- avoid_empty_else
diff --git a/lib/src/shelf_unmodifiable_map.dart b/lib/src/shelf_unmodifiable_map.dart
index d6a5c00..7d4de9b 100644
--- a/lib/src/shelf_unmodifiable_map.dart
+++ b/lib/src/shelf_unmodifiable_map.dart
@@ -22,7 +22,7 @@
/// [source] is copied to a new [Map] to ensure changes to the parameter value
/// after constructions are not reflected.
factory ShelfUnmodifiableMap(Map<String, V> source,
- {bool ignoreKeyCase: false}) {
+ {bool ignoreKeyCase = false}) {
if (source is ShelfUnmodifiableMap<V> &&
// !ignoreKeyCase: no transformation of the input is required
// source._ignoreKeyCase: the input cannot be transformed any more
diff --git a/pubspec.yaml b/pubspec.yaml
index 1db9f8f..57ce77d 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,12 +1,12 @@
name: shelf
-version: 0.7.3+3
+version: 0.7.4-dev
description: Web Server Middleware for Dart
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/shelf
environment:
- sdk: '>=2.0.0-dev.61.0 <3.0.0'
+ sdk: '>=2.0.0 <3.0.0'
dependencies:
async: ^2.0.7
@@ -17,5 +17,6 @@
stream_channel: ^1.0.0
dev_dependencies:
- http: ^0.11.3
- test: ^1.2.0
+ http: ^0.12.0
+ pedantic: ^1.3.0
+ test: ^1.3.4
diff --git a/test/server_handler_test.dart b/test/server_handler_test.dart
index 521a526..8edae23 100644
--- a/test/server_handler_test.dart
+++ b/test/server_handler_test.dart
@@ -4,6 +4,7 @@
import 'dart:async';
+import 'package:pedantic/pedantic.dart';
import 'package:shelf/shelf.dart';
import 'package:test/test.dart';
@@ -54,9 +55,9 @@
});
var closeDone = false;
- serverHandler.server.close().then((_) {
+ unawaited(serverHandler.server.close().then((_) {
closeDone = true;
- });
+ }));
expect(onCloseCalled, isTrue);
await new Future.delayed(Duration.zero);
diff --git a/test/shelf_io_test.dart b/test/shelf_io_test.dart
index ccd7316..fb8faa7 100644
--- a/test/shelf_io_test.dart
+++ b/test/shelf_io_test.dart
@@ -453,7 +453,7 @@
data = await stream.next;
expect(data, equals("world!"));
- controller.close();
+ await controller.close();
expect(stream.hasNext, completion(isFalse));
});