Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Switch to package:dart_flutter_team_lints #251

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.12.17-wip

* Switch to `package:dart_flutter_team_lints`.

## 0.12.16+1

* Require Dart 3.0
Expand Down
11 changes: 10 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
include: package:lints/recommended.yaml
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
errors:
avoid_dynamic_calls: ignore #TODO(mosum): https://github.com/dart-lang/matcher/issues/252
inference_failure_on_collection_literal: ignore
inference_failure_on_function_return_type: ignore
inference_failure_on_instance_creation: ignore
language:
strict-casts: false #TODO(mosum): Fix https://github.com/dart-lang/matcher/issues/253

linter:
rules:
- always_declare_return_types
Expand Down
9 changes: 4 additions & 5 deletions lib/expect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/expect/expect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/expect/throws_matcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: matcher
version: 0.12.16+1
version: 0.12.17-wip
description: >-
Support for specifying test expectations via an extensible Matcher class.
Also includes a number of built-in Matcher implementations for common cases.
Expand All @@ -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
2 changes: 1 addition & 1 deletion test/core_matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/having_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/iterable_matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/map_matchers_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 3 additions & 1 deletion test/mirror_matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/operator_matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/pretty_print_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}

Expand Down
2 changes: 1 addition & 1 deletion test/string_matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/type_matcher_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Loading