Files
packages/script/tool/test/common/package_command_test.mocks.dart
stuartmorgan-g cc3dca67f2 [all] Omit obvious local types (#10511)
Makes the analysis options changes described in
https://github.com/flutter/flutter/issues/178827:
- Adding
[omit_obvious_local_variable_types](https://dart.dev/tools/linter-rules/omit_obvious_local_variable_types)
- Adding
[specify_nonobvious_local_variable_types](https://dart.dev/tools/linter-rules/specify_nonobvious_local_variable_types)
- Adding
[specify_nonobvious_property_types](https://dart.dev/tools/linter-rules/specify_nonobvious_property_types)
- Adding
[type_annotate_public_apis](https://dart.dev/tools/linter-rules/type_annotate_public_apis)
- Removing
[always_specify_types](https://dart.dev/tools/linter-rules/always_specify_types)

After those changes, makes the following repo-wide changes:
- `dart fix --apply` in all packages and in script/tool/
- `dart format` in all packages and in script/tool/
- `update-excerpts` repo tooling command to update excerpts based on the
changes to their sources

Also updates the min Flutter/Dart SDK version to 3.35/3.9 for the
following packages, to avoid `analyze` failures in the `N-2` legacy
analysis run due to what appears to be a 3.9 change in what the Dart
analyzer continues to be an obvious local type in loop iterations:
- go_router
- google_fonts
- google_identity_services_web
- google_maps_flutter_web
- local_auth_platform_interface
- metrics_center
- multicast_dns
- pigeon
- rfw
- shared_preferences
- two_dimensional_scrollables
- vector_graphics_compiler
- mustache_template
- path_parsing

Because this is causing a significant amount of format churn already, I
took this opportunity to update the repository tooling to a min Dart SDK
of 3.8 (the N-2 stable version, so the earliest version we need the
tooling to support) to pick up the new format style, so the amount of
automated formatter change is higher in script/tool/ than in the
packages.

This does contain two manual changes (other than the repo tooling min
version):
-
d700b45c7d
changes `dynamic` to `Object?` in a few places where `dynamic` caused
analyzer warnings under the new rule set.
- Updates the repo tooling to ignore `.dart_tool/` when looking for
unexpected local `analysis_options.yaml` files, to fix issues running
the repo tool's `analyze` command locally based on recent changes in
`dart` behavior.

This does not include any CHANGELOG or version updates; even though we
normally version any changes to production code, mass automated changes
like this aren't worth the churn of releasing. This includes changes to
lib/example/main.dart and to README.md excerpts; while the style changes
will be user-visible on pub.dev, it's fine for those changes to wait for
the next release of each package.

Part of https://github.com/flutter/flutter/issues/178827
2025-11-24 18:26:06 -05:00

275 lines
8.4 KiB
Dart

// Mocks generated by Mockito 5.4.4 from annotations
// in flutter_plugin_tools/test/common/package_command_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i6;
import 'dart:io' as _i10;
import 'package:git/src/branch_reference.dart' as _i3;
import 'package:git/src/commit.dart' as _i2;
import 'package:git/src/commit_reference.dart' as _i8;
import 'package:git/src/git_dir.dart' as _i4;
import 'package:git/src/tag.dart' as _i7;
import 'package:git/src/tree_entry.dart' as _i9;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i5;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeCommit_0 extends _i1.SmartFake implements _i2.Commit {
_FakeCommit_0(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeBranchReference_1 extends _i1.SmartFake
implements _i3.BranchReference {
_FakeBranchReference_1(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
/// A class which mocks [GitDir].
///
/// See the documentation for Mockito's code generation for more information.
class MockGitDir extends _i1.Mock implements _i4.GitDir {
MockGitDir() {
_i1.throwOnMissingStub(this);
}
@override
String get path =>
(super.noSuchMethod(
Invocation.getter(#path),
returnValue: _i5.dummyValue<String>(this, Invocation.getter(#path)),
)
as String);
@override
_i6.Future<int> commitCount([String? branchName = r'HEAD']) =>
(super.noSuchMethod(
Invocation.method(#commitCount, [branchName]),
returnValue: _i6.Future<int>.value(0),
)
as _i6.Future<int>);
@override
_i6.Future<_i2.Commit> commitFromRevision(String? revision) =>
(super.noSuchMethod(
Invocation.method(#commitFromRevision, [revision]),
returnValue: _i6.Future<_i2.Commit>.value(
_FakeCommit_0(
this,
Invocation.method(#commitFromRevision, [revision]),
),
),
)
as _i6.Future<_i2.Commit>);
@override
_i6.Future<Map<String, _i2.Commit>> commits([String? branchName = r'HEAD']) =>
(super.noSuchMethod(
Invocation.method(#commits, [branchName]),
returnValue: _i6.Future<Map<String, _i2.Commit>>.value(
<String, _i2.Commit>{},
),
)
as _i6.Future<Map<String, _i2.Commit>>);
@override
_i6.Future<_i3.BranchReference?> branchReference(String? branchName) =>
(super.noSuchMethod(
Invocation.method(#branchReference, [branchName]),
returnValue: _i6.Future<_i3.BranchReference?>.value(),
)
as _i6.Future<_i3.BranchReference?>);
@override
_i6.Future<List<_i3.BranchReference>> branches() =>
(super.noSuchMethod(
Invocation.method(#branches, []),
returnValue: _i6.Future<List<_i3.BranchReference>>.value(
<_i3.BranchReference>[],
),
)
as _i6.Future<List<_i3.BranchReference>>);
@override
_i6.Stream<_i7.Tag> tags() =>
(super.noSuchMethod(
Invocation.method(#tags, []),
returnValue: _i6.Stream<_i7.Tag>.empty(),
)
as _i6.Stream<_i7.Tag>);
@override
_i6.Future<List<_i8.CommitReference>> showRef({
bool? heads = false,
bool? tags = false,
}) =>
(super.noSuchMethod(
Invocation.method(#showRef, [], {#heads: heads, #tags: tags}),
returnValue: _i6.Future<List<_i8.CommitReference>>.value(
<_i8.CommitReference>[],
),
)
as _i6.Future<List<_i8.CommitReference>>);
@override
_i6.Future<_i3.BranchReference> currentBranch() =>
(super.noSuchMethod(
Invocation.method(#currentBranch, []),
returnValue: _i6.Future<_i3.BranchReference>.value(
_FakeBranchReference_1(
this,
Invocation.method(#currentBranch, []),
),
),
)
as _i6.Future<_i3.BranchReference>);
@override
_i6.Future<List<_i9.TreeEntry>> lsTree(
String? treeish, {
bool? subTreesOnly = false,
String? path,
}) =>
(super.noSuchMethod(
Invocation.method(
#lsTree,
[treeish],
{#subTreesOnly: subTreesOnly, #path: path},
),
returnValue: _i6.Future<List<_i9.TreeEntry>>.value(
<_i9.TreeEntry>[],
),
)
as _i6.Future<List<_i9.TreeEntry>>);
@override
_i6.Future<String?> createOrUpdateBranch(
String? branchName,
String? treeSha,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(#createOrUpdateBranch, [
branchName,
treeSha,
commitMessage,
]),
returnValue: _i6.Future<String?>.value(),
)
as _i6.Future<String?>);
@override
_i6.Future<String> commitTree(
String? treeSha,
String? commitMessage, {
List<String>? parentCommitShas,
}) =>
(super.noSuchMethod(
Invocation.method(
#commitTree,
[treeSha, commitMessage],
{#parentCommitShas: parentCommitShas},
),
returnValue: _i6.Future<String>.value(
_i5.dummyValue<String>(
this,
Invocation.method(
#commitTree,
[treeSha, commitMessage],
{#parentCommitShas: parentCommitShas},
),
),
),
)
as _i6.Future<String>);
@override
_i6.Future<Map<String, String>> writeObjects(List<String>? paths) =>
(super.noSuchMethod(
Invocation.method(#writeObjects, [paths]),
returnValue: _i6.Future<Map<String, String>>.value(
<String, String>{},
),
)
as _i6.Future<Map<String, String>>);
@override
_i6.Future<_i10.ProcessResult> runCommand(
Iterable<String>? args, {
bool? throwOnError = true,
bool? echoOutput = false,
}) =>
(super.noSuchMethod(
Invocation.method(
#runCommand,
[args],
{#throwOnError: throwOnError, #echoOutput: echoOutput},
),
returnValue: _i6.Future<_i10.ProcessResult>.value(
_i5.dummyValue<_i10.ProcessResult>(
this,
Invocation.method(
#runCommand,
[args],
{#throwOnError: throwOnError, #echoOutput: echoOutput},
),
),
),
)
as _i6.Future<_i10.ProcessResult>);
@override
_i6.Future<bool> isWorkingTreeClean() =>
(super.noSuchMethod(
Invocation.method(#isWorkingTreeClean, []),
returnValue: _i6.Future<bool>.value(false),
)
as _i6.Future<bool>);
@override
_i6.Future<_i2.Commit?> updateBranch(
String? branchName,
_i6.Future<void> Function(_i10.Directory)? populater,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(#updateBranch, [
branchName,
populater,
commitMessage,
]),
returnValue: _i6.Future<_i2.Commit?>.value(),
)
as _i6.Future<_i2.Commit?>);
@override
_i6.Future<_i2.Commit?> updateBranchWithDirectoryContents(
String? branchName,
String? sourceDirectoryPath,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(#updateBranchWithDirectoryContents, [
branchName,
sourceDirectoryPath,
commitMessage,
]),
returnValue: _i6.Future<_i2.Commit?>.value(),
)
as _i6.Future<_i2.Commit?>);
}