Skip to content

Commit

Permalink
Update to package:lints v3
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Oct 21, 2023
1 parent 16da7b0 commit e69a0d9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
11 changes: 7 additions & 4 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 0 additions & 2 deletions lib/src/server_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ class ServerInfo {
case 401:
case 403:
unauthorizedCount += 1;
break;
case 503:
serviceUnavailableCount += 1;
break;
default:
otherErrorCount += 1;
break;
Expand Down
3 changes: 0 additions & 3 deletions lib/src/worker/pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}');
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
});

tearDown(() {
out.close();
unawaited(out.close());
});

test('reports no errors or warnings for a site without issues', () async {
Expand Down
6 changes: 3 additions & 3 deletions test/glob_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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', () {
Expand All @@ -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/', () {
Expand All @@ -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());
});
}
4 changes: 2 additions & 2 deletions tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import 'package:cli_pkg/cli_pkg.dart' as pkg;
import 'package:grinder/grinder.dart';

void main(List<String> args) {
void main(List<String> args) async {
pkg.name.value = 'linkcheck';
pkg.humanName.value = 'linkcheck';
pkg.githubRepo.value = 'filiph/linkcheck';
pkg.addAllTasks();
grind(args);
await grind(args);
}

@DefaultTask()
Expand Down

0 comments on commit e69a0d9

Please sign in to comment.