refactor(mocktail): upgrade analysis_options.yaml (#242)

This commit is contained in:
Felix Angelov
2024-06-11 22:26:22 -05:00
committed by GitHub
parent 8a7bd295d9
commit 80a8db5094
2 changed files with 18 additions and 16 deletions

View File

@ -92,6 +92,7 @@ linter:
- no_leading_underscores_for_local_identifiers
- no_logic_in_create_state
- no_runtimeType_toString
- no_wildcard_variable_uses
- non_constant_identifier_names
- noop_primitive_operations
- null_check_on_nullable_type_parameter
@ -153,6 +154,7 @@ linter:
- tighten_type_of_initializing_formals
- type_annotate_public_apis
- type_init_formals
- type_literal_in_constant_pattern
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_brace_in_string_interps

View File

@ -206,11 +206,11 @@ When<T> Function<T>(T Function() x) get when {
throw StateError('Cannot call `when` within a stub response');
}
_whenInProgress = true;
return <T>(T Function() _) {
return <T>(T Function() fn) {
try {
_();
} catch (_) {
if (_ is! TypeError) rethrow;
fn();
} catch (e) {
if (e is! TypeError) rethrow;
}
_whenInProgress = false;
return When<T>();
@ -395,12 +395,12 @@ List<VerificationResult> Function<T>(
throw StateError(_verifyCalls.join());
}
_verificationInProgress = true;
return <T>(List<T Function()> _) {
for (final invocation in _) {
return <T>(List<T Function()> invocations) {
for (final invocation in invocations) {
try {
invocation();
} catch (_) {
if (_ is! TypeError) rethrow;
} catch (e) {
if (e is! TypeError) rethrow;
}
}
@ -503,11 +503,11 @@ Verify _makeVerify(bool never) {
);
}
_verificationInProgress = true;
return <T>(T Function() mock) {
return <T>(T Function() fn) {
try {
mock();
} catch (_) {
if (_ is! TypeError) rethrow;
fn();
} catch (e) {
if (e is! TypeError) rethrow;
}
_verificationInProgress = false;
if (_verifyCalls.length == 1) {
@ -758,11 +758,11 @@ class _VerifyCall {
/// future will return immediately.
Future<Invocation> Function<T>(T Function() _) get untilCalled {
_untilCalledInProgress = true;
return <T>(T Function() _) {
return <T>(T Function() fn) {
try {
_();
} catch (_) {
if (_ is! TypeError) rethrow;
fn();
} catch (e) {
if (e is! TypeError) rethrow;
}
_untilCalledInProgress = false;
return _untilCall!.invocationFuture;