[License] Enable avoid_function_literals_in_foreach_calls lint

This commit is contained in:
Chris Bracken
2018-12-20 12:09:31 -08:00
parent b5e7301452
commit dabdcc19a7
2 changed files with 5 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ analyzer:
linter:
rules:
- avoid_empty_else
- avoid_function_literals_in_foreach_calls
- comment_references
- cancel_subscriptions
- close_sinks

View File

@@ -102,7 +102,8 @@ class _RepositorySourceFile extends _RepositoryLicensedFile {
throw 'file has no detectable license and no in-scope default license file';
}
_licenses.sort();
_licenses.forEach((License license) => license.markUsed(io.fullName, libraryName));
for (License license in licenses)
license.markUsed(io.fullName, libraryName);
assert(_licenses != null && _licenses.isNotEmpty);
return _licenses;
}
@@ -122,7 +123,8 @@ class _RepositoryBinaryFile extends _RepositoryLicensedFile {
_licenses = parent.nearestLicensesFor(name);
if (_licenses == null || _licenses.isEmpty)
throw 'no license file found in scope for ${io.fullName}';
_licenses.forEach((License license) => license.markUsed(io.fullName, libraryName));
for (License license in licenses)
license.markUsed(io.fullName, libraryName);
}
return _licenses;
}