From a362115c600f1853aa64df9016c1705b55d332a9 Mon Sep 17 00:00:00 2001 From: pq Date: Tue, 7 Jun 2022 17:59:29 +0000 Subject: [PATCH] bump to linter 1.25.0 Change-Id: Ie709139029d1f58cef4807708ff054acb0fba6cb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247363 Commit-Queue: Phil Quitslund Reviewed-by: Brian Wilkerson --- CHANGELOG.md | 31 +++++++++++-------- DEPS | 2 +- .../dart/remove_duplicate_case.dart | 2 +- .../services/correction/error_fix_status.yaml | 2 ++ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fd8d3de5c..ac2b73ad6ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,28 +118,33 @@ them, you must set the lower bound on the SDK constraint for your package to #### Linter -Updated the Linter to `1.24.0`, which includes changes that +Updated the Linter to `1.25.0`, which includes changes that -- fixes `prefer_final_parameters` to support super parameters. -- adds new lint: `unnecessary_to_list_in_spreads`. -- fixes `unawaited_futures` to handle string interpolated +- add new lint: `discarded_futures`. +- improve message and highlight range for `no_duplicate_case_values` +- improve performance for `lines_longer_than_80_chars`, + `prefer_const_constructors_in_immutables`, and + `prefer_initializing_formals`. +- fix `prefer_final_parameters` to support super parameters. +- add new lint: `unnecessary_to_list_in_spreads`. +- fix `unawaited_futures` to handle string interpolated futures. -- updates `use_colored_box` to not flag nullable colors, -- adds new lint: +- update `use_colored_box` to not flag nullable colors, +- add new lint: `unnecessary_null_aware_operator_on_extension_on_nullable`. -- fixes `no_leading_underscores_for_local_identifiers` +- fix `no_leading_underscores_for_local_identifiers` to lint local function declarations. -- fixes `avoid_init_to_null` to correctly handle super +- fix `avoid_init_to_null` to correctly handle super initializing defaults that are non-null. -- updates `no_leading_underscores_for_local_identifiers` +- update `no_leading_underscores_for_local_identifiers` to allow identifiers with just underscores. -- fixes `flutter_style_todos` to support usernames that +- fix `flutter_style_todos` to support usernames that start with a digit. -- updates `require_trailing_commas` to handle functions +- update `require_trailing_commas` to handle functions in asserts and multi-line strings. -- updates `unsafe_html` to allow assignments to +- update `unsafe_html` to allow assignments to `img.src`. -- fixes `unnecessary_null_checks` to properly handle map +- fix `unnecessary_null_checks` to properly handle map literal entries. #### Pub diff --git a/DEPS b/DEPS index 110ccc4f488..f1e605f6f7c 100644 --- a/DEPS +++ b/DEPS @@ -120,7 +120,7 @@ vars = { "intl_rev": "9145f308f1458f37630a1ffce3b7d3b471ebbc56", "jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1", "json_rpc_2_rev": "2de9a1f9821807fa2c85fd48e2f70b9cbcddcb67", - "linter_rev": "a8529c6692922b45bc287543b355c90d7b1286d3", # 1.24.0 + "linter_rev": "1ddc70948d94f2449fec69a95e3ceb7b6b6c8348", # 1.25.0 "lints_rev": "8294e5648ab49474541527e2911e72e4c5aefe55", "logging_rev": "f6979e3bc3b6e1847a08335b7eb6304e18986195", "markdown_rev": "e3f4bd28c9e61b522f75f291d4d6cfcfeccd83ee", # 5.0.0 diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart index c8f71ce2a8b..17b3c2c0fe1 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_duplicate_case.dart @@ -25,7 +25,7 @@ class RemoveDuplicateCase extends CorrectionProducer { @override Future compute(ChangeBuilder builder) async { - var node = coveredNode; + var node = coveredNode?.parent; if (node is! SwitchCase) { return; } diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml index 18b6ea650d7..ce4c4883091 100644 --- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml +++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml @@ -1653,6 +1653,8 @@ LintCode.diagnostic_describe_all_properties: status: hasFix LintCode.directives_ordering: status: hasFix +LintCode.discarded_futures: + status: needsEvaluation LintCode.do_not_use_environment: status: needsEvaluation LintCode.empty_catches: