linter 1.32.0

See: https://github.com/dart-lang/linter/issues/3848

Change-Id: I73469ce43d52c1755875a39067b267f216ebd490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275044
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
pq 2022-12-15 22:51:28 +00:00 committed by Commit Queue
parent a6f4fbe17b
commit ea1473e6cd
8 changed files with 21 additions and 7 deletions

View file

@ -78,6 +78,18 @@
documented at
[dart.dev](https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks).
#### Linter
Updates the Linter to `1.32.0`, which includes changes that
- update `avoid_types_as_parameter_names` to handle type variables.
- update `avoid_positional_boolean_parameters` to handle typedefs.
- improve `unnecessary_parenthesis` support for property accesses and method invocations.
- update `avoid_redundant_argument_values` to check parameters of redirecting constructors.
- improve performance for `prefer_const_literals_to_create_immutables`.
- update `use_build_context_synchronously` to check context properties.
- fix a false positive for `avoid_private_typedef_functions` with generalized type aliases.
## 2.19.0
### Language

2
DEPS
View file

@ -139,7 +139,7 @@ vars = {
"intl_rev": "6fb07f261dad98ed5adc6d60a37a76557b0ed6b3",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
"json_rpc_2_rev": "16fed53fbebd38edf170f58c1da1de2a325b2b98",
"linter_rev": "7fe671cdadb52139295bae0abf62c014369af93a", # 1.31.0
"linter_rev": "79b843349deaea4a2455cfa37cc47cbc0e472190", # 1.32.0
"lints_rev": "16bdefe1df529262a6596f79e91003ddbdbd3890",
"logging_rev": "0373ef85aa1dfe9e179b9fa006c45b65903787f2",
"markdown_rev": "ee3f4e976efcfed87c6ec78364bc2dd3c6e717b9", # https://github.com/dart-lang/markdown/pull/494

View file

@ -1707,7 +1707,9 @@ LintCode.avoid_bool_literals_in_conditional_expressions:
fixed to not contain a bool literal.
LintCode.avoid_catches_without_on_clauses:
status: needsEvaluation
LintCode.avoid_catching_errors:
LintCode.avoid_catching_errors_class:
status: needsEvaluation
LintCode.avoid_catching_errors_subclass:
status: needsEvaluation
LintCode.avoid_classes_with_only_static_members:
status: needsEvaluation

View file

@ -14,7 +14,7 @@ void main() {
var pathToAnalyze = provider.pathContext.join(packageRoot, 'analysis_server');
var testDirPath = provider.pathContext.join(pathToAnalyze, 'test');
_VerifyTests(testDirPath, excludedPaths: [
(provider.pathContext.join(testDirPath, 'mock_packages'))
provider.pathContext.join(testDirPath, 'mock_packages')
]).build();
}

View file

@ -41,7 +41,7 @@ class GenericFunctionInferenceTest extends AbstractTypeSystemTest {
);
_assertTypes(
_inferCall(cast, [stringNone]),
[stringNone, (iterableNone(stringNone))],
[stringNone, iterableNone(stringNone)],
);
}

View file

@ -259,7 +259,7 @@ linter:
Future<void> test_pubspec_lintsInOptions_generatedLints() async {
await drive('data/linter_project/pubspec.yaml',
options: 'data/linter_project/$analysisOptionsYaml');
expect(bulletToDash(outSink), contains('lint - Sort pub dependencies'));
expect(bulletToDash(outSink), contains('lint - Unsorted dependencies.'));
}
YamlMap _parseOptions(String src) =>

View file

@ -187,7 +187,7 @@ class Variables {
/// [recordNullCheckHint].
HintComment? getNullCheckHint(Source? source, Expression expression) {
return (_nullCheckHints[source] ??
{})[(uniqueIdentifierForSpan(expression.offset, expression.end))];
{})[uniqueIdentifierForSpan(expression.offset, expression.end)];
}
/// If the given [node] is preceded by a `/*required*/` hint, returns the

View file

@ -1308,7 +1308,7 @@ C<int, String>? c;
var propertyAccess = findNode.propertyAccess('?.');
checkPlan(
planner!.passThrough(propertyAccess, innerPlans: [
(planner!.replace(findNode.simple('x?.'), [AtomicEdit.insert('z')])),
planner!.replace(findNode.simple('x?.'), [AtomicEdit.insert('z')]),
planner!.removeNullAwareness(propertyAccess),
planner!.replace(findNode.simple('y'), [AtomicEdit.insert('w')])
]),