From 90e52ac8864147de690345b0096a6fc41bcf5c35 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Sat, 21 Oct 2023 13:17:56 -0500 Subject: [PATCH 1/2] Update to package:lints v3 --- dwds/lib/src/debugging/remote_debugger.dart | 2 +- dwds/lib/src/utilities/conversions.dart | 2 ++ dwds/lib/src/utilities/objects.dart | 7 ++-- dwds/pubspec.yaml | 2 +- dwds/test/dart_uri_test.dart | 9 ++--- dwds/test/debugger_test.dart | 5 +-- dwds/test/fixtures/debugger_data.dart | 2 ++ dwds/test/fixtures/fakes.dart | 6 ++-- dwds/test/fixtures/utilities.dart | 39 +++++++-------------- dwds/test/location_test.dart | 5 +-- dwds/test/skip_list_test.dart | 5 +-- test_common/pubspec.yaml | 2 +- 12 files changed, 34 insertions(+), 52 deletions(-) diff --git a/dwds/lib/src/debugging/remote_debugger.dart b/dwds/lib/src/debugging/remote_debugger.dart index 2d9dc0bc2..e181eb4fb 100644 --- a/dwds/lib/src/debugging/remote_debugger.dart +++ b/dwds/lib/src/debugging/remote_debugger.dart @@ -5,7 +5,7 @@ import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; class TargetCrashedEvent extends WipEvent { - TargetCrashedEvent(Map json) : super(json); + TargetCrashedEvent(super.json); } /// A generic debugger used in remote debugging. diff --git a/dwds/lib/src/utilities/conversions.dart b/dwds/lib/src/utilities/conversions.dart index fdb398192..f965c0077 100644 --- a/dwds/lib/src/utilities/conversions.dart +++ b/dwds/lib/src/utilities/conversions.dart @@ -3,6 +3,8 @@ // BSD-style license that can be found in the LICENSE file. /// Functions for converting between the different object references we use. +library; + import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; /// Convert [argument] to a form usable in WIP evaluation calls. diff --git a/dwds/lib/src/utilities/objects.dart b/dwds/lib/src/utilities/objects.dart index 0aafa86ec..86680aec1 100644 --- a/dwds/lib/src/utilities/objects.dart +++ b/dwds/lib/src/utilities/objects.dart @@ -2,8 +2,11 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -/// A library for WebKit mirror objects and support code. These probably should -/// get migrated into webkit_inspection_protocol over time. +/// A library for WebKit mirror objects and support code. +/// +/// These probably should get migrated into +/// `package:webkit_inspection_protocol` over time. +library; import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; diff --git a/dwds/pubspec.yaml b/dwds/pubspec.yaml index 662958386..10e0b3b2c 100644 --- a/dwds/pubspec.yaml +++ b/dwds/pubspec.yaml @@ -49,7 +49,7 @@ dev_dependencies: frontend_server_common: path: ../frontend_server_common js: ^0.6.4 - lints: ^2.0.0 + lints: ^3.0.0 pubspec_parse: ^1.2.0 puppeteer: ^3.0.0 stream_channel: ^2.1.0 diff --git a/dwds/test/dart_uri_test.dart b/dwds/test/dart_uri_test.dart index d3479e1d2..e8db8ad03 100644 --- a/dwds/test/dart_uri_test.dart +++ b/dwds/test/dart_uri_test.dart @@ -5,7 +5,6 @@ @TestOn('vm') @Timeout(Duration(minutes: 2)) -import 'package:dwds/asset_reader.dart'; import 'package:dwds/config.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; import 'package:path/path.dart' as p; @@ -16,9 +15,7 @@ import 'fixtures/fakes.dart'; import 'fixtures/utilities.dart'; class TestStrategy extends FakeStrategy { - TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + TestStrategy(super.assetReader); @override String? serverPathForAppUri(String appUrl) { @@ -38,8 +35,8 @@ class TestStrategy extends FakeStrategy { class G3TestStrategy extends FakeStrategy { G3TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + super.assetReader, + ); @override String? g3RelativePath(String absolutePath) => diff --git a/dwds/test/debugger_test.dart b/dwds/test/debugger_test.dart index 6a327bd6e..a21689caf 100644 --- a/dwds/test/debugger_test.dart +++ b/dwds/test/debugger_test.dart @@ -6,7 +6,6 @@ @Timeout(Duration(minutes: 2)) import 'dart:async'; -import 'package:dwds/asset_reader.dart'; import 'package:dwds/src/debugging/debugger.dart'; import 'package:dwds/src/debugging/frame_computer.dart'; import 'package:dwds/src/debugging/inspector.dart'; @@ -30,9 +29,7 @@ late Locations locations; late SkipLists skipLists; class TestStrategy extends FakeStrategy { - TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + TestStrategy(super.assetReader); @override Future moduleForServerPath(String entrypoint, String appUri) async => diff --git a/dwds/test/fixtures/debugger_data.dart b/dwds/test/fixtures/debugger_data.dart index 91fc5c58c..8f9c2c468 100644 --- a/dwds/test/fixtures/debugger_data.dart +++ b/dwds/test/fixtures/debugger_data.dart @@ -3,6 +3,8 @@ // BSD-style license that can be found in the LICENSE file. /// Contains hard-coded test data usable for tests. +library; + import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; // ignore_for_file: prefer_single_quotes diff --git a/dwds/test/fixtures/fakes.dart b/dwds/test/fixtures/fakes.dart index 78f3269fb..ccd9e36e0 100644 --- a/dwds/test/fixtures/fakes.dart +++ b/dwds/test/fixtures/fakes.dart @@ -318,9 +318,9 @@ class FakeExecutionContext extends ExecutionContext { class FakeStrategy extends LoadStrategy { FakeStrategy( - AssetReader assetReader, { - String? packageConfigPath, - }) : super(assetReader, packageConfigPath: packageConfigPath); + super.assetReader, { + super.packageConfigPath, + }); @override Future bootstrapFor(String entrypoint) async => 'dummy_bootstrap'; diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index 4e1e00090..fdf1eef06 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -116,32 +116,19 @@ class TestDebugSettings extends DebugSettings { TestDebugSettings.noDevTools() : super(enableDevToolsLaunch: false); TestDebugSettings._({ - required bool enableDebugging, - required bool enableDebugExtension, - required bool useSseForDebugBackend, - required bool useSseForDebugProxy, - required bool useSseForInjectedClient, - required bool spawnDds, - required bool enableDevToolsLaunch, - required bool launchDevToolsInNewWindow, - required bool emitDebugEvents, - required DevToolsLauncher? devToolsLauncher, - required ExpressionCompiler? expressionCompiler, - required UrlEncoder? urlEncoder, - }) : super( - enableDebugging: enableDebugging, - enableDebugExtension: enableDebugExtension, - useSseForDebugBackend: useSseForDebugBackend, - useSseForDebugProxy: useSseForDebugProxy, - useSseForInjectedClient: useSseForInjectedClient, - spawnDds: spawnDds, - enableDevToolsLaunch: enableDevToolsLaunch, - launchDevToolsInNewWindow: launchDevToolsInNewWindow, - emitDebugEvents: emitDebugEvents, - devToolsLauncher: devToolsLauncher, - expressionCompiler: expressionCompiler, - urlEncoder: urlEncoder, - ); + required super.enableDebugging, + required super.enableDebugExtension, + required super.useSseForDebugBackend, + required super.useSseForDebugProxy, + required super.useSseForInjectedClient, + required super.spawnDds, + required super.enableDevToolsLaunch, + required super.launchDevToolsInNewWindow, + required super.emitDebugEvents, + required super.devToolsLauncher, + required super.expressionCompiler, + required super.urlEncoder, + }); TestDebugSettings copyWith({ bool? enableDebugging, diff --git a/dwds/test/location_test.dart b/dwds/test/location_test.dart index efe2a2899..09db87ca2 100644 --- a/dwds/test/location_test.dart +++ b/dwds/test/location_test.dart @@ -4,7 +4,6 @@ @Timeout(Duration(minutes: 2)) -import 'package:dwds/asset_reader.dart'; import 'package:dwds/src/debugging/location.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; import 'package:test/test.dart'; @@ -188,9 +187,7 @@ const _serverPath = 'web/main.dart'; const _sourceMapPath = 'packages/module.js.map'; class MockLoadStrategy extends FakeStrategy { - MockLoadStrategy( - AssetReader assetReader, - ) : super(assetReader); + MockLoadStrategy(super.assetReader); @override Future moduleForServerPath( diff --git a/dwds/test/skip_list_test.dart b/dwds/test/skip_list_test.dart index 4049a7959..55f3908a3 100644 --- a/dwds/test/skip_list_test.dart +++ b/dwds/test/skip_list_test.dart @@ -4,7 +4,6 @@ @Timeout(Duration(minutes: 2)) -import 'package:dwds/asset_reader.dart'; import 'package:dwds/src/debugging/location.dart'; import 'package:dwds/src/debugging/skip_list.dart'; import 'package:dwds/src/utilities/dart_uri.dart'; @@ -15,9 +14,7 @@ import 'fixtures/fakes.dart'; import 'fixtures/utilities.dart'; class TestStrategy extends FakeStrategy { - TestStrategy( - AssetReader assetReader, - ) : super(assetReader); + TestStrategy(super.assetReader); @override String serverPathForAppUri(String appUri) { diff --git a/test_common/pubspec.yaml b/test_common/pubspec.yaml index 760d45f98..f6d99ae5f 100644 --- a/test_common/pubspec.yaml +++ b/test_common/pubspec.yaml @@ -13,6 +13,6 @@ dependencies: test: ^1.21.1 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 pubspec_parse: ^1.2.2 pub_semver: ^2.1.1 From 94a0839e967095b4013321f115de1af4ea09ad52 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Wed, 1 Nov 2023 19:36:59 -0500 Subject: [PATCH 2/2] Minor cleanup --- dwds/test/dart_uri_test.dart | 4 +--- dwds/test/fixtures/utilities.dart | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dwds/test/dart_uri_test.dart b/dwds/test/dart_uri_test.dart index b0a144723..74972b1c2 100644 --- a/dwds/test/dart_uri_test.dart +++ b/dwds/test/dart_uri_test.dart @@ -33,9 +33,7 @@ class TestStrategy extends FakeStrategy { } class G3TestStrategy extends FakeStrategy { - G3TestStrategy( - super.assetReader, - ); + G3TestStrategy(super.assetReader); @override String? g3RelativePath(String absolutePath) => diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index f33734148..5c722e068 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -165,14 +165,14 @@ class TestAppMetadata extends AppMetadata { const TestAppMetadata({ super.isInternalBuild, super.workspaceName, - super.hostname, + super.hostname = 'localhost', }); TestAppMetadata copyWith({ bool? isFlutterApp, bool? isInternalBuild, String? workspaceName, - String? hostname = 'localhost', + String? hostname, }) => TestAppMetadata( isInternalBuild: isInternalBuild ?? this.isInternalBuild,