[dtd] Minor spelling fixes and analysis cleanup
Change-Id: I0b6a1d161b078d377f17022ad8d45e6757e77974
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386829
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Helin Shiah <helinx@google.com>
diff --git a/pkg/dtd/README.md b/pkg/dtd/README.md
index 3a5346a..9db045b 100644
--- a/pkg/dtd/README.md
+++ b/pkg/dtd/README.md
@@ -4,7 +4,7 @@
## What is the Dart Tooling Daemon?
-The Dart Tooling Daemon is a long running process meant to facilitate
+The Dart Tooling Daemon is a long-running process meant to facilitate
communication between Dart tools and minimal file system access for a Dart
development workspace.
@@ -20,7 +20,7 @@
## Quick Start
```dart
-import "package:dtd"
+import 'package:dtd/dtd.dart';
/// Since the Dart Tooling Daemon exists within the context of a development
/// environment, any tool using DTD can expect a development environment to
@@ -52,7 +52,7 @@
`client` can then be used to interact with the Dart Tooling Daemon.
-See the [Examples](#examples) for details on the built in interactions.
+See the [Examples](#examples) for details on the built-in interactions.
## Examples
diff --git a/pkg/dtd/analysis_options.yaml b/pkg/dtd/analysis_options.yaml
index d89b7c1..27ddbd1 100644
--- a/pkg/dtd/analysis_options.yaml
+++ b/pkg/dtd/analysis_options.yaml
@@ -1,5 +1,9 @@
include: package:dart_flutter_team_lints/analysis_options.yaml
+analyzer:
+ language:
+ strict-raw-types: true
+
linter:
rules:
- avoid_void_async
diff --git a/pkg/dtd/example/dtd_file_system_service_example.dart b/pkg/dtd/example/dtd_file_system_service_example.dart
index 0ed5f93..05a7f63 100644
--- a/pkg/dtd/example/dtd_file_system_service_example.dart
+++ b/pkg/dtd/example/dtd_file_system_service_example.dart
@@ -23,8 +23,8 @@
final dtdSecret = args.length >= 3 ? args[2] : null;
- // Create the client that will be talking to the FileSystem service..
- DartToolingDaemon? client = await DartToolingDaemon.connect(
+ // Create the client that will be talking to the FileSystem service.
+ final client = await DartToolingDaemon.connect(
Uri.parse(dtdUrl),
);
diff --git a/pkg/dtd/example/dtd_service_example.dart b/pkg/dtd/example/dtd_service_example.dart
index 19d07a7..3cfbb03 100644
--- a/pkg/dtd/example/dtd_service_example.dart
+++ b/pkg/dtd/example/dtd_service_example.dart
@@ -52,7 +52,7 @@
// ExampleServer.getServerState.
final getStateRequest = GetStateRequest.fromParams(params);
- final duration = const Duration(minutes: 45);
+ const duration = Duration(minutes: 45);
final status =
getStateRequest.verbose ? 'The server is running' : 'Running';
diff --git a/pkg/dtd/lib/src/dart_tooling_daemon.dart b/pkg/dtd/lib/src/dart_tooling_daemon.dart
index ad045cd..57d6024 100644
--- a/pkg/dtd/lib/src/dart_tooling_daemon.dart
+++ b/pkg/dtd/lib/src/dart_tooling_daemon.dart
@@ -62,7 +62,7 @@
}
late final Peer _clientPeer;
- late final Future _done;
+ late final Future<void> _done;
final _subscribedStreamControllers = <String, StreamController<DTDEvent>>{};
/// Terminates the connection with the Dart Tooling Daemon.
@@ -199,7 +199,7 @@
throw DartToolingDaemonConnectionException.callResponseMissingType(json);
}
- //TODO(danchevalier): Find out how to get access to the id.
+ // TODO(danchevalier): Find out how to get access to the id.
return DTDResponse('-1', type, json);
}
diff --git a/pkg/dtd/lib/src/response_types.dart b/pkg/dtd/lib/src/response_types.dart
index ba28b11..b014086 100644
--- a/pkg/dtd/lib/src/response_types.dart
+++ b/pkg/dtd/lib/src/response_types.dart
@@ -7,7 +7,7 @@
import 'dart_tooling_daemon.dart';
/// A DTD response that indicates success.
-class Success extends _SuccessResponse {
+class Success extends _SuccessResponse<Null> {
const Success();
factory Success.fromDTDResponse(DTDResponse response) {
@@ -18,7 +18,7 @@
@override
String get type => _type;
- static final _type = 'Success';
+ static const _type = 'Success';
}
/// A DTD response that indicates success and contains a single String value.
@@ -34,7 +34,7 @@
@override
String get type => _type;
- static final _type = 'StringResponse';
+ static const _type = 'StringResponse';
}
/// A DTD response that indicates success and contains a single boolean value.
@@ -50,7 +50,7 @@
@override
String get type => _type;
- static final _type = 'BoolResponse';
+ static const _type = 'BoolResponse';
}
/// A DTD response that indicates success and contains a single [List] of
@@ -68,7 +68,7 @@
@override
String get type => _type;
- static final _type = 'ListResponse';
+ static const _type = 'ListResponse';
}
/// A DTD response that indicates success and contains a single optional value
diff --git a/pkg/dtd/lib/src/unified_analytics_service.dart b/pkg/dtd/lib/src/unified_analytics_service.dart
index 380b3d3..78a89cc 100644
--- a/pkg/dtd/lib/src/unified_analytics_service.dart
+++ b/pkg/dtd/lib/src/unified_analytics_service.dart
@@ -13,7 +13,7 @@
///
/// This library lives under src/ and is intentionally not exported from lib/.
/// First party Dash products that use this service should import this library
-/// from src/ and add an analyzer ignore to supress the warning.
+/// from src/ and add an analyzer ignore to suppress the warning.
extension UnifiedAnalyticsExtension on DartToolingDaemon {
/// Gets the Dart and Flutter unified analytics consent message to prompt
/// users with on first run or when the message has been updated.
diff --git a/pkg/dtd/pubspec.yaml b/pkg/dtd/pubspec.yaml
index 61977bd..ee8d1e0 100644
--- a/pkg/dtd/pubspec.yaml
+++ b/pkg/dtd/pubspec.yaml
@@ -1,10 +1,10 @@
name: dtd
-version: 2.3.0
+version: 2.3.1-wip
description: A package for communicating with the Dart Tooling Daemon.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/dtd
environment:
- sdk: ">=3.0.0 <4.0.0"
+ sdk: ^3.0.0
dependencies:
json_rpc_2: ^3.0.2
diff --git a/pkg/dtd/test/file_system_service_test.dart b/pkg/dtd/test/file_system_service_test.dart
index ac790be..eebb816 100644
--- a/pkg/dtd/test/file_system_service_test.dart
+++ b/pkg/dtd/test/file_system_service_test.dart
@@ -481,7 +481,7 @@
);
});
- test('prevents access outide of workspace roots for relative paths',
+ test('prevents access outside of workspace roots for relative paths',
() async {
await client.setIDEWorkspaceRoots(dtdSecret, [fooDirectory.uri]);
expect(
diff --git a/pkg/dtd/test/unified_analytics_service_test.dart b/pkg/dtd/test/unified_analytics_service_test.dart
index fb21593..f7dc4e7 100644
--- a/pkg/dtd/test/unified_analytics_service_test.dart
+++ b/pkg/dtd/test/unified_analytics_service_test.dart
@@ -44,7 +44,7 @@
});
test('shouldShowMessage', () async {
- var response = await client.analyticsShouldShowConsentMessage(tool);
+ final response = await client.analyticsShouldShowConsentMessage(tool);
// Since `clientShowedMessage` has already been called on the
// FakeAnalytics instance when we create it in package:dtd_impl, this will
// return false.