Make dart analyzer info warnings fatal (#629)
diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml
index 086396a..a621cdb 100644
--- a/.github/workflows/dart.yml
+++ b/.github/workflows/dart.yml
@@ -31,13 +31,13 @@
- name: Install dependencies
run: dart pub get
- name: Analyze code (lib and test)
- run: dart analyze .
+ run: dart analyze --fatal-infos .
- name: Analyze code (example)
run: |
cd example
echo [Analyzing example]
dart pub get
- dart analyze .
+ dart analyze --fatal-infos .
- name: Prepare Flutter
run: |
git submodule init
diff --git a/lib/services_cloud_run.dart b/lib/services_cloud_run.dart
index 2eaf18b..07e4aa4 100644
--- a/lib/services_cloud_run.dart
+++ b/lib/services_cloud_run.dart
@@ -103,7 +103,7 @@
.addMiddleware(logRequests())
.addMiddleware(_createCustomCorsHeadersMiddleware());
- handler = pipeline.addHandler(commonServerApi.router.handler);
+ handler = pipeline.addHandler(commonServerApi.router);
}
Middleware _createCustomCorsHeadersMiddleware() {
diff --git a/lib/services_dev.dart b/lib/services_dev.dart
index 2b48a3c..c535398 100644
--- a/lib/services_dev.dart
+++ b/lib/services_dev.dart
@@ -78,7 +78,7 @@
.addMiddleware(logRequests())
.addMiddleware(_createCustomCorsHeadersMiddleware());
- handler = pipeline.addHandler(commonServerApi.router.handler);
+ handler = pipeline.addHandler(commonServerApi.router);
}
Middleware _createCustomCorsHeadersMiddleware() {
diff --git a/lib/services_gae.dart b/lib/services_gae.dart
index 44e6311..3f6591b 100644
--- a/lib/services_gae.dart
+++ b/lib/services_gae.dart
@@ -115,7 +115,7 @@
} else if (request.uri.path == _livenessCheck) {
await _processLivenessRequest(request);
} else if (request.uri.path.startsWith(_API_PREFIX)) {
- await shelf_io.handleRequest(request, commonServerApi.router.handler);
+ await shelf_io.handleRequest(request, commonServerApi.router);
} else {
await _processDefaultRequest(request);
}
diff --git a/test/common_server_api_protobuf_test.dart b/test/common_server_api_protobuf_test.dart
index a9aae8f..d1456c6 100644
--- a/test/common_server_api_protobuf_test.dart
+++ b/test/common_server_api_protobuf_test.dart
@@ -70,7 +70,7 @@
request.headers.add('content-type', JSON_CONTENT_TYPE);
request.add(utf8.encode(json.encode(message.toProto3Json())));
await request.close();
- await shelf_io.handleRequest(request, commonServerApi.router.handler);
+ await shelf_io.handleRequest(request, commonServerApi.router);
return request.response;
}
@@ -82,7 +82,7 @@
final request = MockHttpRequest('POST', uri);
request.headers.add('content-type', JSON_CONTENT_TYPE);
await request.close();
- await shelf_io.handleRequest(request, commonServerApi.router.handler);
+ await shelf_io.handleRequest(request, commonServerApi.router);
return request.response;
}
diff --git a/test/common_server_api_test.dart b/test/common_server_api_test.dart
index badb672..6fffa9f 100644
--- a/test/common_server_api_test.dart
+++ b/test/common_server_api_test.dart
@@ -255,7 +255,7 @@
request.headers.add('content-type', JSON_CONTENT_TYPE);
request.add(utf8.encode(json.encode(jsonData)));
await request.close();
- await shelf_io.handleRequest(request, commonServerApi.router.handler);
+ await shelf_io.handleRequest(request, commonServerApi.router);
return request.response;
}
@@ -267,7 +267,7 @@
final request = MockHttpRequest('POST', uri);
request.headers.add('content-type', JSON_CONTENT_TYPE);
await request.close();
- await shelf_io.handleRequest(request, commonServerApi.router.handler);
+ await shelf_io.handleRequest(request, commonServerApi.router);
return request.response;
}