From 4b8d407eae10b1bfab8518e22f4a9e519f9ddbf3 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Thu, 29 Jun 2017 13:11:29 -0700 Subject: [PATCH] Fixes to make Travis Green (#17) * Remove unused import * Only analyze lib and test dirs - work-around for https://github.com/dart-lang/sdk/issues/26212 * enable a few more lints * remove unused field --- .travis.yml | 4 +++- analysis_options.yaml | 3 +++ examples/route_guide/lib/src/client.dart | 2 +- examples/route_guide/lib/src/server.dart | 3 +-- lib/src/client.dart | 1 - lib/src/server.dart | 2 -- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index cfe2c240..4f14490d 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 17f69a3b..4c5d70c0 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 860c20e8..b8646994 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 c8a8f0a6..1d95860e 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 9a0ea4e8..5afab029 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 cc7373ad..0c222d81 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';