diff --git a/.travis.yml b/.travis.yml index cfe2c24..4f14490 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,10 @@ matrix: include: - dart: stable dart_task: dartfmt + # Wish we could exclude `examples` in `analysis_options.yaml` but it seems + # blocked by https://github.com/dart-lang/sdk/issues/26212 - dart: dev - dart_task: dartanalyzer + dart_task: dartanalyzer lib test # Only building master means that we don't run two builds for each pull request. branches: diff --git a/analysis_options.yaml b/analysis_options.yaml index 17f69a3..4c5d70c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -6,13 +6,16 @@ analyzer: # Lint rules and documentation, see http://dart-lang.github.io/linter/lints linter: rules: + - avoid_init_to_null - cancel_subscriptions - close_sinks + - directives_ordering - hash_and_equals - iterable_contains_unrelated_type - list_remove_unrelated_type - prefer_final_fields - prefer_final_locals + - prefer_is_not_empty - test_types_in_equals - unrelated_type_equality_checks - valid_regexps diff --git a/examples/route_guide/lib/src/client.dart b/examples/route_guide/lib/src/client.dart index 860c20e..b864699 100644 --- a/examples/route_guide/lib/src/client.dart +++ b/examples/route_guide/lib/src/client.dart @@ -7,9 +7,9 @@ import 'dart:math' show Random; import 'package:grpc/grpc.dart'; +import 'common.dart'; import 'generated/route_guide.pb.dart'; import 'generated/route_guide.pbgrpc.dart'; -import 'common.dart'; class Client { ClientChannel channel; diff --git a/examples/route_guide/lib/src/server.dart b/examples/route_guide/lib/src/server.dart index c8a8f0a..1d95860 100644 --- a/examples/route_guide/lib/src/server.dart +++ b/examples/route_guide/lib/src/server.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:async'; -import 'dart:io'; import 'dart:math' show PI, atan2, cos, max, min, sin, sqrt; import 'package:grpc/grpc.dart' as grpc; @@ -66,7 +65,7 @@ class RouteGuideService extends RouteGuideServiceBase { int pointCount = 0; int featureCount = 0; double distance = 0.0; - Point previous = null; + Point previous; final timer = new Stopwatch(); await for (var location in request) { diff --git a/lib/src/client.dart b/lib/src/client.dart index 9a0ea4e..5afab02 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -55,7 +55,6 @@ class ClientMethod { class ClientCall implements Response { static final _methodPost = new Header.ascii(':method', 'POST'); static final _schemeHttp = new Header.ascii(':scheme', 'http'); - static final _schemeHttps = new Header.ascii(':scheme', 'https'); static final _contentTypeGrpc = new Header.ascii('content-type', 'application/grpc'); static final _teTrailers = new Header.ascii('te', 'trailers'); diff --git a/lib/src/server.dart b/lib/src/server.dart index cc7373a..0c222d8 100644 --- a/lib/src/server.dart +++ b/lib/src/server.dart @@ -5,8 +5,6 @@ import 'dart:async'; import 'dart:io'; -import 'package:meta/meta.dart'; -import 'package:http2/multiprotocol_server.dart'; import 'package:http2/transport.dart'; import 'streams.dart';