Skip to content

Commit d33d270

Browse files
authored
[dwds] Sync state with sdk/g3 and restore static analysis for fixtures (#2824)
Synced changes from the Dart SDK ([CL 494660](https://dart-review.googlesource.com/c/sdk/+/494660)) to bring DWDS up to parity with the state of the sdk/g3 workspace. This will ensure the changes made are not overwritten when syncing the webdev repo with the sdk or in follow up roll into g3. **Key Changes:** - Narrowed the static analysis exclusion from the entire test/integration/fixtures/ folder to only the specific files that depend on package:build_daemon. This restores lint coverage for the rest of the fixtures folder while ensuring that files dependent on build_daemon don't break the SDK environment where the package isn't supported. - Restored static analysis for files under lib/data/ and resolved active lint warnings across them. - Added `dwds/lib/src/utilities/test_path_utils.dart` which to used to resolve CI failures in sdk environment. - Convert `packageConfigPath` constructor parameter to use a super parameter in `ddc.dart`, `ddc_library_bundle.dart` and `require.dart` to resolve the `use_super_parameters` lint warning in the sdk. Related to dart-lang/sdk#62102, dart-lang/sdk#62100, dart-lang/sdk#62101, dart-lang/sdk#62103
1 parent e43744b commit d33d270

21 files changed

Lines changed: 122 additions & 74 deletions

dwds/OWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set noparent
2+
# Dart Development Infrastructure Team
3+
file:/tools/OWNERS_DEV_INFRA

dwds/analysis_options.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ include: package:dart_flutter_team_lints/analysis_options.yaml
33
analyzer:
44
exclude:
55
# Ignore generated files
6-
- "lib/data/*"
76
- "lib/src/handlers/injected_client_js.dart"
7+
# Ignore integration fixtures to avoid analysis errors from "package:build_daemon".
8+
- "test/integration/fixtures/context.dart"
9+
- "test/integration/fixtures/server.dart"
10+
- "test/integration/fixtures/utilities.dart"
811

912
linter:
1013
rules:

dwds/lib/data/debug_event.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class BatchedDebugEvents {
7777
bool _listEquals<T>(List<T>? a, List<T>? b) {
7878
if (a == null) return b == null;
7979
if (b == null || a.length != b.length) return false;
80-
for (int i = 0; i < a.length; i++) {
80+
for (var i = 0; i < a.length; i++) {
8181
if (a[i] != b[i]) return false;
8282
}
8383
return true;

dwds/lib/data/extension_request.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class ExtensionRequest {
4949

5050
@override
5151
String toString() =>
52-
'ExtensionRequest { id=$id, command=$command, commandParams=$commandParams }';
52+
'ExtensionRequest { id=$id, command=$command, '
53+
'commandParams=$commandParams }';
5354

5455
@override
5556
bool operator ==(Object other) =>
@@ -111,7 +112,8 @@ class ExtensionResponse {
111112

112113
@override
113114
String toString() =>
114-
'ExtensionResponse { id=$id, success=$success, result=$result, error=$error }';
115+
'ExtensionResponse { id=$id, success=$success, '
116+
'result=$result, error=$error }';
115117

116118
@override
117119
bool operator ==(Object other) =>
@@ -195,7 +197,7 @@ class BatchedEvents {
195197
identical(this, other) ||
196198
other is BatchedEvents &&
197199
runtimeType == other.runtimeType &&
198-
const ListEquality().equals(events, other.events);
200+
const ListEquality<ExtensionEvent>().equals(events, other.events);
199201

200202
@override
201203
int get hashCode => Object.hashAll(events);

dwds/lib/data/hot_reload_request.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library hot_reload_request;
6-
75
/// A request to hot reload the application.
86
class HotReloadRequest {
97
/// A unique identifier for this request.

dwds/lib/data/hot_reload_response.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library hot_reload_response;
6-
75
/// A response to a hot reload request.
86
class HotReloadResponse {
97
/// The unique identifier matching the request.
@@ -50,5 +48,6 @@ class HotReloadResponse {
5048

5149
@override
5250
String toString() =>
53-
'HotReloadResponse(id: $id, success: $success, errorMessage: $errorMessage)';
51+
'HotReloadResponse(id: $id, success: $success, '
52+
'errorMessage: $errorMessage)';
5453
}

dwds/lib/data/hot_restart_request.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
library hot_restart_request;
6-
75
/// A request to hot restart the application.
86
class HotRestartRequest {
97
/// A unique identifier for this request.

dwds/lib/data/utils.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Map<String, dynamic> listToMap(List<dynamic> list, {String? type}) {
2323

2424
if ((list.length - startIndex).isOdd) {
2525
throw FormatException(
26-
'Expected an even number of elements${type != null ? " after $type" : ""}',
26+
'Expected an even number of elements'
27+
'${type != null ? " after $type" : ""}',
2728
list,
2829
);
2930
}

dwds/lib/src/loaders/ddc.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ class DdcStrategy extends LoadStrategy {
146146
AssetReader assetReader,
147147
this._buildSettings,
148148
this._g3RelativePath, {
149-
String? packageConfigPath,
150-
}) : super(assetReader, packageConfigPath: packageConfigPath);
149+
super.packageConfigPath,
150+
}) : super(assetReader);
151151

152152
@override
153153
Handler get handler => (request) async {

dwds/lib/src/loaders/ddc_library_bundle.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ class DdcLibraryBundleStrategy extends LoadStrategy {
146146
AssetReader assetReader,
147147
this._buildSettings,
148148
this._g3RelativePath, {
149-
String? packageConfigPath,
149+
super.packageConfigPath,
150150
this.reloadedSourcesUri,
151151
this.injectScriptLoad = true,
152-
}) : super(assetReader, packageConfigPath: packageConfigPath);
152+
}) : super(assetReader);
153153

154154
@override
155155
Handler get handler => (request) async {

0 commit comments

Comments
 (0)