From e69a0d93628d3a21bea5c4e3dd83c46cec037dde Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Sat, 21 Oct 2023 14:26:38 -0500 Subject: [PATCH] Update to package:lints v3 --- analysis_options.yaml | 11 +++++++---- lib/src/server_info.dart | 2 -- lib/src/worker/pool.dart | 3 --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- test/e2e_test.dart | 2 +- test/glob_test.dart | 6 +++--- tool/grind.dart | 4 ++-- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 2ce03da..7e2eff2 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -9,12 +9,13 @@ analyzer: linter: rules: - always_declare_return_types + - collection_methods_unrelated_type - combinators_ordering - comment_references - - dangling_library_doc_comments - deprecated_member_use_from_same_package - - implicit_call_tearoffs + - discarded_futures - implicit_reopen + - invalid_case_patterns - library_annotations - matching_super_parameters - no_literal_bool_comparisons @@ -23,11 +24,13 @@ linter: - prefer_final_in_for_each - prefer_final_locals - prefer_single_quotes + - test_types_in_equals - type_annotate_public_apis - - type_literal_in_constant_pattern - unawaited_futures + - unnecessary_breaks + - unnecessary_late - unnecessary_library_directive + - unnecessary_to_list_in_spreads - unreachable_from_main - use_enums - - use_string_in_part_of_directives - use_super_parameters diff --git a/lib/src/server_info.dart b/lib/src/server_info.dart index e835b04..38a78d6 100644 --- a/lib/src/server_info.dart +++ b/lib/src/server_info.dart @@ -96,10 +96,8 @@ class ServerInfo { case 401: case 403: unauthorizedCount += 1; - break; case 503: serviceUnavailableCount += 1; - break; default: otherErrorCount += 1; break; diff --git a/lib/src/worker/pool.dart b/lib/src/worker/pool.dart index 2accca4..3f89e24 100644 --- a/lib/src/worker/pool.dart +++ b/lib/src/worker/pool.dart @@ -109,15 +109,12 @@ class Pool { final fetchResults = message.data as FetchResults; _fetchResultsSink.add(fetchResults); worker.destinationToCheck = null; - break; case WorkerVerb.checkServerDone: final serverUpdateResult = message.data as ServerInfoUpdate; _serverCheckSink.add(serverUpdateResult); worker.serverToCheck = null; - break; case WorkerVerb.infoFromWorker: _messagesSink.add(message.data as String); - break; default: throw StateError('Unrecognized verb from Worker: ' '${message.verb}'); diff --git a/pubspec.lock b/pubspec.lock index fc7b803..002a9ec 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -237,10 +237,10 @@ packages: dependency: "direct dev" description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "3.0.0" logging: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b9f6a9c..b0a8069 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: stream_channel: ^2.1.2 dev_dependencies: - lints: ^2.1.1 + lints: ^3.0.0 dhttpd: ^4.0.0 test: ^1.24.4 cli_pkg: ^2.5.0 diff --git a/test/e2e_test.dart b/test/e2e_test.dart index 42d52a2..3e95976 100644 --- a/test/e2e_test.dart +++ b/test/e2e_test.dart @@ -18,7 +18,7 @@ void main() { }); tearDown(() { - out.close(); + unawaited(out.close()); }); test('reports no errors or warnings for a site without issues', () async { diff --git a/test/glob_test.dart b/test/glob_test.dart index 9000772..92a0a2d 100644 --- a/test/glob_test.dart +++ b/test/glob_test.dart @@ -11,7 +11,7 @@ void main() { final uri = Uri.parse('http://localhost:4000/'); options.addHostGlobs(['$uri**']); expect(options.matchesAsInternal(uri), isTrue); - sink.close(); + unawaited(sink.close()); }); test('parses localhost:4000/guides', () { @@ -20,7 +20,7 @@ void main() { final uri = Uri.parse('http://localhost:4000/guides'); options.addHostGlobs(['$uri**']); expect(options.matchesAsInternal(uri), isTrue); - sink.close(); + unawaited(sink.close()); }); test('parses localhost:4000/guides/', () { @@ -29,6 +29,6 @@ void main() { final uri = Uri.parse('http://localhost:4000/guides/'); options.addHostGlobs(['http://localhost:4000/guides**']); expect(options.matchesAsInternal(uri), isTrue); - sink.close(); + unawaited(sink.close()); }); } diff --git a/tool/grind.dart b/tool/grind.dart index 433c125..313ba1b 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -3,12 +3,12 @@ import 'package:cli_pkg/cli_pkg.dart' as pkg; import 'package:grinder/grinder.dart'; -void main(List args) { +void main(List args) async { pkg.name.value = 'linkcheck'; pkg.humanName.value = 'linkcheck'; pkg.githubRepo.value = 'filiph/linkcheck'; pkg.addAllTasks(); - grind(args); + await grind(args); } @DefaultTask()