diff --git a/analysis_options.yaml b/analysis_options.yaml index f0f137f..0ea8e3f 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,5 +1,13 @@ -include: package:lints/recommended.yaml +include: package:dart_flutter_team_lints/analysis_options.yaml +analyzer: + errors: + avoid_dynamic_calls: ignore + inference_failure_on_collection_literal: ignore + inference_failure_on_function_return_type: ignore + inference_failure_on_instance_creation: ignore + strict-casts: false + linter: rules: - always_declare_return_types diff --git a/lib/expect.dart b/lib/expect.dart index c842d30..e3865eb 100644 --- a/lib/expect.dart +++ b/lib/expect.dart @@ -5,7 +5,6 @@ // ignore_for_file: deprecated_member_use_from_same_package export 'matcher.dart'; - export 'src/expect/expect.dart' show ErrorFormatter, expect, expectLater, fail; export 'src/expect/expect_async.dart' show @@ -38,14 +37,14 @@ export 'src/expect/prints_matcher.dart' show prints; export 'src/expect/stream_matcher.dart' show StreamMatcher; export 'src/expect/stream_matchers.dart' show - emitsDone, emits, - emitsError, - mayEmit, emitsAnyOf, - emitsInOrder, + emitsDone, + emitsError, emitsInAnyOrder, + emitsInOrder, emitsThrough, + mayEmit, mayEmitMultiple, neverEmits; export 'src/expect/throws_matcher.dart' show Throws, throws, throwsA; diff --git a/lib/src/expect/expect.dart b/lib/src/expect/expect.dart index 8dd8cae..81e57f5 100644 --- a/lib/src/expect/expect.dart +++ b/lib/src/expect/expect.dart @@ -74,7 +74,10 @@ Future expectLater(dynamic actual, dynamic matcher, /// The implementation of [expect] and [expectLater]. Future _expect(Object? actual, Object? matcher, - {String? reason, skip, bool verbose = false, ErrorFormatter? formatter}) { + {String? reason, + Object? skip, + bool verbose = false, + ErrorFormatter? formatter}) { final test = TestHandle.current; formatter ??= (actual, matcher, reason, matchState, verbose) { var mismatchDescription = StringDescription(); diff --git a/lib/src/expect/throws_matcher.dart b/lib/src/expect/throws_matcher.dart index 0ee3144..89fc852 100644 --- a/lib/src/expect/throws_matcher.dart +++ b/lib/src/expect/throws_matcher.dart @@ -117,7 +117,7 @@ class Throws extends AsyncMatcher { /// Verifies that [error] matches [_matcher] and returns a [String] /// description of the failure if it doesn't. - String? _check(error, StackTrace? trace) { + String? _check(dynamic error, StackTrace? trace) { if (_matcher == null) return null; var matchState = {}; diff --git a/pubspec.yaml b/pubspec.yaml index 8b6df88..9fb4c67 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,6 +16,7 @@ dependencies: test_api: ">=0.5.0 <0.8.0" dev_dependencies: + dart_flutter_team_lints: ^2.1.1 fake_async: ^1.3.0 lints: ^3.0.0 test: ^1.23.0 diff --git a/test/core_matchers_test.dart b/test/core_matchers_test.dart index 04fc8b3..62e7d75 100644 --- a/test/core_matchers_test.dart +++ b/test/core_matchers_test.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:matcher/matcher.dart'; -import 'package:test/test.dart' show test, group; +import 'package:test/test.dart' show group, test; import 'test_utils.dart'; diff --git a/test/having_test.dart b/test/having_test.dart index ddada77..26592cd 100644 --- a/test/having_test.dart +++ b/test/having_test.dart @@ -5,7 +5,7 @@ // ignore_for_file: lines_longer_than_80_chars import 'package:matcher/matcher.dart'; -import 'package:test/test.dart' show test, expect, throwsA, group; +import 'package:test/test.dart' show expect, group, test, throwsA; import 'test_utils.dart'; diff --git a/test/iterable_matchers_test.dart b/test/iterable_matchers_test.dart index 7607d18..2d55fd8 100644 --- a/test/iterable_matchers_test.dart +++ b/test/iterable_matchers_test.dart @@ -196,7 +196,7 @@ void main() { equals(2), // 2 allOf([lessThan(3), isNot(0)]), // 1 equals(0), // 0 - predicate((int v) => v % 2 == 1), // 3 + predicate((int v) => v.isOdd), // 3 equals(5), // 5 ])); shouldFail( diff --git a/test/map_matchers_test.dart b/test/map_matchers_test.dart index 4c699ab..f7dbafe 100644 --- a/test/map_matchers_test.dart +++ b/test/map_matchers_test.dart @@ -1,5 +1,5 @@ import 'package:matcher/matcher.dart' - show contains, containsValue, containsPair; + show contains, containsPair, containsValue; import 'package:test/test.dart' show test; import 'test_utils.dart'; diff --git a/test/mirror_matchers_test.dart b/test/mirror_matchers_test.dart index b19fe3e..cc4e757 100644 --- a/test/mirror_matchers_test.dart +++ b/test/mirror_matchers_test.dart @@ -2,10 +2,12 @@ // 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. -// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: unreachable_from_main @TestOn('vm') +library; +// ignore: deprecated_member_use_from_same_package import 'package:matcher/mirror_matchers.dart'; import 'package:test/test.dart'; diff --git a/test/operator_matchers_test.dart b/test/operator_matchers_test.dart index f4b6d3a..46151e0 100644 --- a/test/operator_matchers_test.dart +++ b/test/operator_matchers_test.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:matcher/matcher.dart'; -import 'package:test/test.dart' show test, expect, throwsArgumentError; +import 'package:test/test.dart' show expect, test, throwsArgumentError; import 'test_utils.dart'; diff --git a/test/pretty_print_test.dart b/test/pretty_print_test.dart index 184704b..62f3ab1 100644 --- a/test/pretty_print_test.dart +++ b/test/pretty_print_test.dart @@ -6,7 +6,7 @@ import 'dart:collection'; import 'package:matcher/matcher.dart'; import 'package:matcher/src/pretty_print.dart'; -import 'package:test/test.dart' show group, test, expect; +import 'package:test/test.dart' show expect, group, test; class DefaultToString {} diff --git a/test/string_matchers_test.dart b/test/string_matchers_test.dart index be9e768..0820015 100644 --- a/test/string_matchers_test.dart +++ b/test/string_matchers_test.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:matcher/matcher.dart'; -import 'package:test/test.dart' show test, expect; +import 'package:test/test.dart' show expect, test; import 'test_utils.dart'; diff --git a/test/type_matcher_test.dart b/test/type_matcher_test.dart index 99d4459..15fc247 100644 --- a/test/type_matcher_test.dart +++ b/test/type_matcher_test.dart @@ -4,7 +4,7 @@ // ignore_for_file: deprecated_member_use_from_same_package import 'package:matcher/matcher.dart'; -import 'package:test/test.dart' show test, group; +import 'package:test/test.dart' show group, test; import 'test_utils.dart';