enable lint prefer_final_in_for_each (#47724)
This commit is contained in:
committed by
GitHub
parent
fa337f5922
commit
4f9b6cf017
@@ -34,7 +34,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
Map<String, List<ProcessResult>> get fakeResults => _fakeResults;
|
||||
set fakeResults(Map<String, List<ProcessResult>> value) {
|
||||
_fakeResults = <String, List<ProcessResult>>{};
|
||||
for (String key in value.keys) {
|
||||
for (final String key in value.keys) {
|
||||
_fakeResults[key] = (value[key] ?? <ProcessResult>[ProcessResult(0, 0, '', '')]).toList();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ class FakeProcessManager extends Mock implements ProcessManager {
|
||||
/// parameters were in the same order.
|
||||
void verifyCalls(List<String> calls) {
|
||||
int index = 0;
|
||||
for (String call in calls) {
|
||||
for (final String call in calls) {
|
||||
expect(call.split(' '), orderedEquals(invocations[index].positionalArguments[0] as Iterable<dynamic>));
|
||||
index++;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ class StringStreamConsumer implements StreamConsumer<List<int>> {
|
||||
|
||||
@override
|
||||
Future<dynamic> close() async {
|
||||
for (Completer<dynamic> completer in completers) {
|
||||
for (final Completer<dynamic> completer in completers) {
|
||||
await completer.future;
|
||||
}
|
||||
completers.clear();
|
||||
|
||||
@@ -34,7 +34,7 @@ void main() {
|
||||
],
|
||||
};
|
||||
processManager.fakeResults = calls;
|
||||
for (String key in calls.keys) {
|
||||
for (final String key in calls.keys) {
|
||||
final Process process = await processManager.start(key.split(' '));
|
||||
String output = '';
|
||||
process.stdout.listen((List<int> item) {
|
||||
@@ -56,7 +56,7 @@ void main() {
|
||||
],
|
||||
};
|
||||
processManager.fakeResults = calls;
|
||||
for (String key in calls.keys) {
|
||||
for (final String key in calls.keys) {
|
||||
final ProcessResult result = await processManager.run(key.split(' '));
|
||||
expect(result.stdout, equals(calls[key][0].stdout));
|
||||
}
|
||||
@@ -73,7 +73,7 @@ void main() {
|
||||
],
|
||||
};
|
||||
processManager.fakeResults = calls;
|
||||
for (String key in calls.keys) {
|
||||
for (final String key in calls.keys) {
|
||||
final ProcessResult result = processManager.runSync(key.split(' '));
|
||||
expect(result.stdout, equals(calls[key][0].stdout));
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void main() {
|
||||
],
|
||||
};
|
||||
processManager.fakeResults = calls;
|
||||
for (String key in calls.keys) {
|
||||
for (final String key in calls.keys) {
|
||||
final Process process = await processManager.start(key.split(' '));
|
||||
String output = '';
|
||||
process.stdout.listen((List<int> item) {
|
||||
|
||||
@@ -35,7 +35,7 @@ void main() {
|
||||
);
|
||||
}
|
||||
});
|
||||
for (String platformName in <String>['macos', 'linux', 'windows']) {
|
||||
for (final String platformName in <String>['macos', 'linux', 'windows']) {
|
||||
final FakePlatform platform = FakePlatform(
|
||||
operatingSystem: platformName,
|
||||
environment: <String, String>{
|
||||
|
||||
@@ -27,7 +27,7 @@ void main() {
|
||||
'1.2.3+hotfix.1',
|
||||
'1.2.3+hotfix.12-pre.12',
|
||||
];
|
||||
for (String version in valid_versions) {
|
||||
for (final String version in valid_versions) {
|
||||
when(file.readAsString()).thenAnswer((Invocation invocation) => Future<String>.value(version));
|
||||
expect(
|
||||
await verifyVersion(file),
|
||||
@@ -47,7 +47,7 @@ void main() {
|
||||
' 1.2.3',
|
||||
'1.2.3-hotfix.1',
|
||||
];
|
||||
for (String version in invalid_versions) {
|
||||
for (final String version in invalid_versions) {
|
||||
when(file.readAsString()).thenAnswer((Invocation invocation) => Future<String>.value(version));
|
||||
expect(
|
||||
await verifyVersion(file),
|
||||
|
||||
Reference in New Issue
Block a user