[pkg/testing] restore analysis options settings

Use package:lints/recommended.yaml for pkg/testing.

Change-Id: I15aedcc4c82447a9d033b575adae745eb138f6f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/363484
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This commit is contained in:
Devon Carew 2024-04-19 14:45:41 +00:00 committed by Commit Queue
parent 6250303b38
commit 828e6032b3
3 changed files with 11 additions and 20 deletions

View file

@ -2,6 +2,8 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
include: package:lints/recommended.yaml
analyzer:
errors:
# Allow having TODOs in the code
@ -9,18 +11,8 @@ analyzer:
linter:
rules:
- collection_methods_unrelated_type
- curly_braces_in_flow_control_structures
- prefer_adjacent_string_concatenation
- unawaited_futures
- avoid_void_async
- recursive_getters
- avoid_empty_else
- empty_statements
- valid_regexps
- package_api_docs
- lines_longer_than_80_chars
- unrelated_type_equality_checks
- annotate_overrides
- always_declare_return_types
# - always_specify_types
- avoid_void_async
- lines_longer_than_80_chars
- package_api_docs
- unawaited_futures

View file

@ -66,10 +66,10 @@ class Chain extends Suite {
List<String> includeEndsWith =
List<String>.from(json['includeEndsWith'] ?? const []);
List<RegExp> pattern = [
for (final p in json['pattern'] ?? const []) new RegExp(p)
for (final p in json['pattern'] ?? const []) RegExp(p)
];
List<RegExp> exclude = [
for (final e in json['exclude'] ?? const []) new RegExp(e)
for (final e in json['exclude'] ?? const []) RegExp(e)
];
return Chain(name, kind, source, rootUri, subRoots, statusFile,
includeEndsWith, pattern, exclude);
@ -289,7 +289,7 @@ abstract class ChainContext {
include = true;
}
if (include) {
result.add(new FileBasedTestDescription(suite.root, entity));
result.add(FileBasedTestDescription(suite.root, entity));
}
}
} else {
@ -419,7 +419,7 @@ Future<void> runChain(CreateContext f, Map<String, String> environment,
}
RegExp _createRegExpForAsterisk(String s) {
StringBuffer sb = new StringBuffer("^");
StringBuffer sb = StringBuffer("^");
String between = "";
for (String split in s.split("*")) {
sb.write(between);
@ -427,5 +427,5 @@ RegExp _createRegExpForAsterisk(String s) {
sb.write(RegExp.escape(split));
}
sb.write("\$");
return new RegExp(sb.toString());
return RegExp(sb.toString());
}

View file

@ -140,7 +140,6 @@ class CommandLine {
void fail(String message) {
print(message);
io.exitCode = 1;
return null;
}
Future<void> main(List<String> arguments) {