mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:50:11 +00:00
Replace deprecated lint rules in front-end packages
Two rules, `iterable_contains_unrelated_type` and `list_remove_unrelated_type` are deprecated (which fails the CI) and replaced with `collection_methods_unrelated_type`. See https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780614474452305057/+/u/analyze_pkg_/stdout for the failures resulting from referencing deprecated rules. Change-Id: I00087e684bfb230b5dc94ab832c969ed67a631f7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304780 Commit-Queue: Samuel Rawlins <srawlins@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
a7c8d997ab
commit
f292b20dfd
|
@ -7,14 +7,13 @@ include: analysis_options_no_lints.yaml
|
|||
linter:
|
||||
rules:
|
||||
- annotate_overrides
|
||||
- collection_methods_unrelated_type
|
||||
- curly_braces_in_flow_control_structures
|
||||
- prefer_adjacent_string_concatenation
|
||||
- unawaited_futures
|
||||
- recursive_getters
|
||||
- avoid_empty_else
|
||||
- empty_statements
|
||||
- list_remove_unrelated_type
|
||||
- iterable_contains_unrelated_type
|
||||
- valid_regexps
|
||||
- package_api_docs
|
||||
- lines_longer_than_80_chars
|
||||
|
|
|
@ -88,6 +88,9 @@ class TestEnvironment implements ObjectPropertyLookup {
|
|||
if (fields.isNotEmpty) {
|
||||
Map<Key, _Type> fieldMap = _fields[cls] ??= {};
|
||||
for (MapEntry<String, StaticType> entry in fields.entries) {
|
||||
// TODO(srawlins): Look into fixing this code. Right now we get:
|
||||
// "The argument type 'String' isn't related to 'Key'."
|
||||
// ignore: collection_methods_unrelated_type
|
||||
assert(!fieldMap.containsKey(entry.key),
|
||||
"Duplicate field '${entry.key}' in $cls.");
|
||||
fieldMap[new NameKey(entry.key)] = _typeFromStaticType(entry.value);
|
||||
|
|
|
@ -3628,6 +3628,9 @@ main() {
|
|||
|
||||
var s = FlowModel<Type>(Reachability.initial)._write(
|
||||
h, null, objectQVar, Type('Object?'), new SsaNode<Type>(null));
|
||||
// TODO(srawlins): Look into fixing this code. Right now we get:
|
||||
// "The argument type 'Var' isn't related to 'int'."
|
||||
// ignore: collection_methods_unrelated_type
|
||||
expect(s.variableInfo[objectQVar], isNull);
|
||||
});
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ analyzer:
|
|||
|
||||
linter:
|
||||
rules:
|
||||
- collection_methods_unrelated_type
|
||||
- curly_braces_in_flow_control_structures
|
||||
- prefer_adjacent_string_concatenation
|
||||
- unawaited_futures
|
||||
|
@ -17,8 +18,6 @@ linter:
|
|||
- recursive_getters
|
||||
- avoid_empty_else
|
||||
- empty_statements
|
||||
- list_remove_unrelated_type
|
||||
- iterable_contains_unrelated_type
|
||||
- valid_regexps
|
||||
- package_api_docs
|
||||
- lines_longer_than_80_chars
|
||||
|
|
|
@ -24,6 +24,9 @@ void main(List<String> args) {
|
|||
Map<String, TopLevelDeclarationEnd> classes = {};
|
||||
for (TopLevelDeclarationEnd cls in ast.getClasses()) {
|
||||
IdentifierHandle identifier = cls.getIdentifier();
|
||||
// TODO(srawlins): Look into fixing this code. Right now we get:
|
||||
// "The argument type 'Token' isn't related to 'String'."
|
||||
// ignore: collection_methods_unrelated_type
|
||||
assert(classes[identifier.token] == null);
|
||||
classes[identifier.token.toString()] = cls;
|
||||
}
|
||||
|
|
|
@ -4,14 +4,13 @@ analyzer:
|
|||
|
||||
linter:
|
||||
rules:
|
||||
- collection_methods_unrelated_type
|
||||
- curly_braces_in_flow_control_structures
|
||||
- prefer_adjacent_string_concatenation
|
||||
- unawaited_futures
|
||||
- recursive_getters
|
||||
- avoid_empty_else
|
||||
- empty_statements
|
||||
- list_remove_unrelated_type
|
||||
- iterable_contains_unrelated_type
|
||||
- valid_regexps
|
||||
- package_api_docs
|
||||
- lines_longer_than_80_chars
|
||||
|
|
Loading…
Reference in a new issue