Repository navigation
[analysis] Upgrade package:analyzer to 14.3.0 and enable custom plugin compilation - #191590
auto-submit[bot] merged 24 commits into
Conversation
…n compilation Upgrades `package:analyzer` to `14.1.0` and `_fe_analyzer_shared` to `105.0.0` in root `pubspec.yaml`, resolving modern `analysis_server_plugin: 0.3.20`, `analyzer_plugin: 0.14.14`, `dart_style: 3.1.12`, and `analyzer_testing: 0.3.4`. Changes include: - Adds `dev/flutter_analyzer_plugin` to `_updatePubspec` in `packages/flutter_tools/lib/src/commands/update_packages.dart` and adds hermetic test coverage in `update_packages_test.dart`. - Migrates `dev/flutter_analyzer_plugin` AST node patterns and reflective test fixtures to Analyzer 14 APIs and `package:analyzer_testing`. - Migrates `dev/snippets` (`analysis.dart` and mock `filesystem_resource_provider.dart`) to Analyzer 14. - Adds `dependency_overrides: analysis_server_plugin: ^0.3.20` to subpackage `analysis_options.yaml` files to ensure isolated plugin runners resolve cleanly on development/master Dart SDKs. - Replaces `scope.catchError` with `scope.then(..., onError: ...)` in `packages/flutter_tools/lib/src/desktop_device.dart`. - Adds missing `@protected` annotations to public `State` subtypes in `packages/flutter/lib` (`popup_menu.dart`, `scaffold.dart`, `tooltip.dart`, `form.dart`, `raw_tooltip.dart`).
|
This pull request contains changes to Material or Cupertino, which are currently frozen in this repository. Changes should be made in Please refer to #188444 for instructions. |
There was a problem hiding this comment.
Code Review
This pull request upgrades the repository's Dart analyzer dependency to version 14.1.0 and updates related packages such as analysis_server_plugin, test_api, and _fe_analyzer_shared. It adapts the custom analysis rules in flutter_analyzer_plugin and dev/snippets to the new analyzer APIs, replacing usages of NamedExpression with NamedArgument and updating AST node accessors. Additionally, @Protected annotations are added to several framework methods in the Flutter package, and the update_packages command is updated to include flutter_analyzer_plugin. Feedback on the changes suggests removing a redundant assignment to enclosingClass in dev/snippets/lib/src/analysis.dart.
…er lint rules Fixes false positives across custom analysis rules: - Fixes logic error in `IntegrationTestTimeouts` file path filtering so it only runs on `test_driver` files. - Filters `GoldenTestTags` file path checking to `packages/flutter/test` golden tests. - Excludes self-referencing test files in `RepositoryLinkSyntax` and `TabooDocumentation`. - Registers package-specific rules using `registerLintRule` so they are opt-in per package via `diagnostics:` in `analysis_options.yaml`, while retaining repo-wide validations as `registerWarningRule`. - Fixes directive ordering in test files.
…in-aot-compilation # Conflicts: # dev/integration_tests/hook_user_defines/pubspec.yaml # packages/flutter_tools/pubspec.yaml # pubspec.yaml
…ts, and taboo_documentation Fixes false positives across custom analysis rules: - `no_sync_async_star`: Excludes test files (`/test/` and `_test.dart`) to match original `dev/bots/analyze.dart` behavior. - `skip_test_comments`: Excludes non-test files and ignores parameter forwarding expressions (`skip: skip`, `skip: false`). Added missing justification comment in `variable_expansion_windows_test.dart`. - `taboo_documentation`: Restricts taboo check to public framework documentation (excluding tests and internal `flutter_tools` developer notes).
…_state_subtypes and fix analyzer plugin rule scopes - Exempt `src/material/` and `src/cupertino/` paths in `protect_public_state_subtypes` rule as these packages are marked read-only, and revert `@protected` annotations in Material State subclasses. - Update `no_sync_async_star` rule scope to packages and examples, and check `definingUnit` filepath. - Restrict `no_test_imports` rule to `packages/` to avoid flagging devicelab and tooling runner helpers. - Restrict `integration_test_timeouts` rule to `dev/` directory. - Exclude `analyze-test-input` fixture directory from `deprecation_syntax` rule. - Broaden `skip_test_comments` inline ignore lookup window to scan all lines of multi-line argument nodes. - Add missing `[intended]` annotations for justified test skips in `theme_data_test.dart`, `stretch_effect_test.dart`, and `format_test.dart`.
…rial and cupertino packages Introduces `FlutterAnalysisRule` as the base class for custom analysis rules in `dev/flutter_analyzer_plugin`. `FlutterAnalysisRule` intercepts `registerNodeProcessors` and checks whether the file being analyzed belongs to read-only Material or Cupertino implementations or tests, skipping rule registration if true. Migrates all 17 custom rules to extend `FlutterAnalysisRule` and implement `registerCustomNodeProcessors`. Reverts test annotations in `packages/flutter/test/material/theme_data_test.dart` to upstream master state as Material tests are exempt from custom rules.
…4.2.0 Upgrades `analysis_server_plugin` to `0.3.21` across `pubspec.lock` and updates `plugins.dependency_overrides` across `analysis_options.yaml` files. This version includes AOT compilation of analyzer plugins and directory-level configuration scoping. Also aligns the Analyzer dependency stack: - `analyzer: 14.2.0` - `_fe_analyzer_shared: 106.0.0` - `analyzer_plugin: 0.14.15` - `analyzer_testing: 0.4.0`
The physical Linux devicelab bots running `Linux analyzer_benchmark` (`flutter-devicelab-linux-*`) have 7.5 GB of RAM. When the `flutter_analyzer_plugin` runs without upstream pre-resolution gating optimizations, resident memory pressure on the host can lead to premature termination of the Swarming task runner process. Update `Linux analyzer_benchmark` in `.ci.yaml` to set `device_type: none` and remove the `mokey` tag, routing the task to devicelab drone VM bots with 32 GB of RAM. Towards flutter#175276
…educe memory Pass '--no-with-fine-dependencies' to the language server in AnalyzeOnce. Fine-grained dependency tracking builds and retains declaration-level requirements manifests to speed up subsequent incremental analysis, which is unnecessary in one-shot batch CLI analysis and adds memory overhead.
…ugin 0.3.20 Reverts commit 1b63861 because analyzer 14.2.0 was retracted on pub.dev, causing pub upgrade to fail on clean CI bots with 'analyzer 14.2.0 which doesn\'t match any versions'.
…4.3.0 Upgrades `analysis_server_plugin` to `0.3.22` across `pubspec.lock` and updates `plugins.dependency_overrides` across `analysis_options.yaml` files. This version includes AOT compilation of analyzer plugins and directory-level configuration scoping. Also aligns the Analyzer dependency stack: - `analyzer: 14.3.0` - `_fe_analyzer_shared: 107.0.0` - `analyzer_plugin: 0.14.16` - `analyzer_testing: 0.4.1`
…in-aot-compilation
flutter/flutter@0cbd1a4...70797e1 2026-09-02 bkonyi@google.com [analysis] Upgrade package:analyzer to 14.3.0 and enable custom plugin compilation (flutter/flutter#191590) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from d8d7869d8031 to 9a8fbde80f6c (1 revision) (flutter/flutter#192179) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from dec311244db4 to ae22da2e8308 (1 revision) (flutter/flutter#192177) 2026-09-02 bkonyi@google.com [tool] Migrate DoctorCommand to modular dependency injection (flutter/flutter#190758) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 482b7e285244 to dec311244db4 (3 revisions) (flutter/flutter#192161) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 28447e9fb8d5 to 482b7e285244 (3 revisions) (flutter/flutter#192157) 2026-09-02 34465683+rkishan516@users.noreply.github.com feat: Add placeholder to DecorationImage (flutter/flutter#191528) 2026-09-02 papmodern14@gmail.com [Android] Do not schedule engine frames on a detached FlutterJNI (flutter/flutter#191204) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 3a242fb7cdb3 to 28447e9fb8d5 (1 revision) (flutter/flutter#192145) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 9164def35347 to d8d7869d8031 (2 revisions) (flutter/flutter#192144) 2026-09-02 74458687+anazr9@users.noreply.github.com Add FadeInImageTransition.fadeInOver to fade the image in over the placeholder (flutter/flutter#186246) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 63d13ec4df6d to 3a242fb7cdb3 (9 revisions) (flutter/flutter#192138) 2026-09-02 bkonyi@google.com [flutter_tools] Add --no-plugins flag and disable plugins for benchmark (flutter/flutter#192129) 2026-09-02 bkonyi@google.com [tool] Migrate ChannelCommand to modular dependency injection (flutter/flutter#190751) 2026-09-01 46920873+gabrimatic@users.noreply.github.com Add mouseCursor to RawScrollbar (flutter/flutter#185750) 2026-09-01 ksanaullah383.khan@gmail.com Fix self-comparison and assert typos in TestSemantics (flutter/flutter#191938) 2026-09-01 robert.ancell@canonical.com [Linux] Wait for frames to be rendered before using them in another context (flutter/flutter#192094) 2026-09-01 jacksongardner@google.com [wimp] Turn on multithreading for wimp. (flutter/flutter#191747) 2026-09-01 engine-flutter-autoroll@skia.org Roll Skia from 3911a1fe7f7a to 63d13ec4df6d (6 revisions) (flutter/flutter#192125) 2026-09-01 jason-simmons@users.noreply.github.com Remove the redundant flutter/shell/platform/android:robolectric_tests build target (flutter/flutter#192117) 2026-09-01 AfzalivE@users.noreply.github.com [iOS] Preserve semantics parents after reparenting (flutter/flutter#189686) 2026-09-01 bkonyi@google.com [flutter_tools] Report preview reload timing analytics in LspPreviewDetector (flutter/flutter#192120) 2026-09-01 bkonyi@google.com [flutter_tools] Implement Templates slice and flutter create integration (flutter/flutter#191748) 2026-09-01 louisehsu@google.com Uiscene migrate add2app hosts (flutter/flutter#191847) 2026-09-01 engine-flutter-autoroll@skia.org Roll Packages from d642322 to 7a7912f (8 revisions) (flutter/flutter#192119) 2026-09-01 zhongliu88889@gmail.com [web] Anchor flt-semantics-host at 0,0 to fix WebKit semantics offset (flutter/flutter#190486) 2026-09-01 jason-simmons@users.noreply.github.com Replace Shell::WaitForFirstFrame with an asynchronous API that matches the Shell threading model (flutter/flutter#191841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12727) flutter/flutter@0cbd1a4...70797e1 2026-09-02 bkonyi@google.com [analysis] Upgrade package:analyzer to 14.3.0 and enable custom plugin compilation (flutter/flutter#191590) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from d8d7869d8031 to 9a8fbde80f6c (1 revision) (flutter/flutter#192179) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from dec311244db4 to ae22da2e8308 (1 revision) (flutter/flutter#192177) 2026-09-02 bkonyi@google.com [tool] Migrate DoctorCommand to modular dependency injection (flutter/flutter#190758) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 482b7e285244 to dec311244db4 (3 revisions) (flutter/flutter#192161) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 28447e9fb8d5 to 482b7e285244 (3 revisions) (flutter/flutter#192157) 2026-09-02 34465683+rkishan516@users.noreply.github.com feat: Add placeholder to DecorationImage (flutter/flutter#191528) 2026-09-02 papmodern14@gmail.com [Android] Do not schedule engine frames on a detached FlutterJNI (flutter/flutter#191204) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 3a242fb7cdb3 to 28447e9fb8d5 (1 revision) (flutter/flutter#192145) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 9164def35347 to d8d7869d8031 (2 revisions) (flutter/flutter#192144) 2026-09-02 74458687+anazr9@users.noreply.github.com Add FadeInImageTransition.fadeInOver to fade the image in over the placeholder (flutter/flutter#186246) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 63d13ec4df6d to 3a242fb7cdb3 (9 revisions) (flutter/flutter#192138) 2026-09-02 bkonyi@google.com [flutter_tools] Add --no-plugins flag and disable plugins for benchmark (flutter/flutter#192129) 2026-09-02 bkonyi@google.com [tool] Migrate ChannelCommand to modular dependency injection (flutter/flutter#190751) 2026-09-01 46920873+gabrimatic@users.noreply.github.com Add mouseCursor to RawScrollbar (flutter/flutter#185750) 2026-09-01 ksanaullah383.khan@gmail.com Fix self-comparison and assert typos in TestSemantics (flutter/flutter#191938) 2026-09-01 robert.ancell@canonical.com [Linux] Wait for frames to be rendered before using them in another context (flutter/flutter#192094) 2026-09-01 jacksongardner@google.com [wimp] Turn on multithreading for wimp. (flutter/flutter#191747) 2026-09-01 engine-flutter-autoroll@skia.org Roll Skia from 3911a1fe7f7a to 63d13ec4df6d (6 revisions) (flutter/flutter#192125) 2026-09-01 jason-simmons@users.noreply.github.com Remove the redundant flutter/shell/platform/android:robolectric_tests build target (flutter/flutter#192117) 2026-09-01 AfzalivE@users.noreply.github.com [iOS] Preserve semantics parents after reparenting (flutter/flutter#189686) 2026-09-01 bkonyi@google.com [flutter_tools] Report preview reload timing analytics in LspPreviewDetector (flutter/flutter#192120) 2026-09-01 bkonyi@google.com [flutter_tools] Implement Templates slice and flutter create integration (flutter/flutter#191748) 2026-09-01 louisehsu@google.com Uiscene migrate add2app hosts (flutter/flutter#191847) 2026-09-01 engine-flutter-autoroll@skia.org Roll Packages from d642322 to 7a7912f (8 revisions) (flutter/flutter#192119) 2026-09-01 zhongliu88889@gmail.com [web] Anchor flt-semantics-host at 0,0 to fix WebKit semantics offset (flutter/flutter#190486) 2026-09-01 jason-simmons@users.noreply.github.com Replace Shell::WaitForFirstFrame with an asynchronous API that matches the Shell threading model (flutter/flutter#191841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#12727) flutter/flutter@0cbd1a4...70797e1 2026-09-02 bkonyi@google.com [analysis] Upgrade package:analyzer to 14.3.0 and enable custom plugin compilation (flutter/flutter#191590) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from d8d7869d8031 to 9a8fbde80f6c (1 revision) (flutter/flutter#192179) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from dec311244db4 to ae22da2e8308 (1 revision) (flutter/flutter#192177) 2026-09-02 bkonyi@google.com [tool] Migrate DoctorCommand to modular dependency injection (flutter/flutter#190758) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 482b7e285244 to dec311244db4 (3 revisions) (flutter/flutter#192161) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 28447e9fb8d5 to 482b7e285244 (3 revisions) (flutter/flutter#192157) 2026-09-02 34465683+rkishan516@users.noreply.github.com feat: Add placeholder to DecorationImage (flutter/flutter#191528) 2026-09-02 papmodern14@gmail.com [Android] Do not schedule engine frames on a detached FlutterJNI (flutter/flutter#191204) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 3a242fb7cdb3 to 28447e9fb8d5 (1 revision) (flutter/flutter#192145) 2026-09-02 engine-flutter-autoroll@skia.org Roll Dart SDK from 9164def35347 to d8d7869d8031 (2 revisions) (flutter/flutter#192144) 2026-09-02 74458687+anazr9@users.noreply.github.com Add FadeInImageTransition.fadeInOver to fade the image in over the placeholder (flutter/flutter#186246) 2026-09-02 engine-flutter-autoroll@skia.org Roll Skia from 63d13ec4df6d to 3a242fb7cdb3 (9 revisions) (flutter/flutter#192138) 2026-09-02 bkonyi@google.com [flutter_tools] Add --no-plugins flag and disable plugins for benchmark (flutter/flutter#192129) 2026-09-02 bkonyi@google.com [tool] Migrate ChannelCommand to modular dependency injection (flutter/flutter#190751) 2026-09-01 46920873+gabrimatic@users.noreply.github.com Add mouseCursor to RawScrollbar (flutter/flutter#185750) 2026-09-01 ksanaullah383.khan@gmail.com Fix self-comparison and assert typos in TestSemantics (flutter/flutter#191938) 2026-09-01 robert.ancell@canonical.com [Linux] Wait for frames to be rendered before using them in another context (flutter/flutter#192094) 2026-09-01 jacksongardner@google.com [wimp] Turn on multithreading for wimp. (flutter/flutter#191747) 2026-09-01 engine-flutter-autoroll@skia.org Roll Skia from 3911a1fe7f7a to 63d13ec4df6d (6 revisions) (flutter/flutter#192125) 2026-09-01 jason-simmons@users.noreply.github.com Remove the redundant flutter/shell/platform/android:robolectric_tests build target (flutter/flutter#192117) 2026-09-01 AfzalivE@users.noreply.github.com [iOS] Preserve semantics parents after reparenting (flutter/flutter#189686) 2026-09-01 bkonyi@google.com [flutter_tools] Report preview reload timing analytics in LspPreviewDetector (flutter/flutter#192120) 2026-09-01 bkonyi@google.com [flutter_tools] Implement Templates slice and flutter create integration (flutter/flutter#191748) 2026-09-01 louisehsu@google.com Uiscene migrate add2app hosts (flutter/flutter#191847) 2026-09-01 engine-flutter-autoroll@skia.org Roll Packages from d642322 to 7a7912f (8 revisions) (flutter/flutter#192119) 2026-09-01 zhongliu88889@gmail.com [web] Anchor flt-semantics-host at 0,0 to fix WebKit semantics offset (flutter/flutter#190486) 2026-09-01 jason-simmons@users.noreply.github.com Replace Shell::WaitForFirstFrame with an asynchronous API that matches the Shell threading model (flutter/flutter#191841) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Description
Upgrades
package:analyzerto14.2.0and_fe_analyzer_sharedto106.0.0in the rootpubspec.yaml, pulling in modern transitive dependencies (analysis_server_plugin: 0.3.21,analyzer_plugin: 0.14.15,dart_style: 3.1.12, andanalyzer_testing: 0.4.0).Key Changes:
package:analyzerto14.2.0and updated lockfiles.dev/flutter_analyzer_pluginto_updatePubspecinpackages/flutter_tools/lib/src/commands/update_packages.dartand added hermetic test coverage inupdate_packages_test.dart.FlutterAnalysisRuleindev/flutter_analyzer_plugin/lib/src/flutter_analysis_rule.dartwhich interceptsregisterNodeProcessorsand automatically skips rule and visitor registration for read-only Material and Cupertino implementations and tests.dev/flutter_analyzer_pluginrules to extendFlutterAnalysisRuleand implementregisterCustomNodeProcessors.package:analyzer_testing.dev/flutter_analyzer_plugin/test/flutter_analysis_rule_test.dartverifying path filtering behavior.no_sync_async_star: Restricted topackages/andexamples/, excluding test files.no_test_imports: Restricted topackages/to avoid flagging runner helpers.integration_test_timeouts: Restricted todev/directory.deprecation_syntax: Excludedanalyze-test-inputfixtures.skip_test_comments: Expanded ignore scan window across multi-line argument nodes.dev/snippetsAST visitors and mock filesystem resource provider to Analyzer 14.dependency_overrides: analysis_server_plugin: ^0.3.21to subpackageanalysis_options.yamlfiles to allow isolated plugin runners to resolve on development/master Dart SDKs that specify unreleased protocol constraints.scope.catchErrorwithscope.then(..., onError: ...)inpackages/flutter_tools/lib/src/desktop_device.dart.@protectedannotations to non-material publicStatesubtypes inpackages/flutter/lib(form.dart,raw_tooltip.dart).dev/bots/analyze.dartanddev/devicelab/lib/tasks/analysis.dart.Linux analyzer_benchmarkin.ci.yamlto setdevice_type: none, routing to 32 GB RAM VM drone bots.Tests
packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart.dev/flutter_analyzer_plugin/test/flutter_analysis_rule_test.dart.dev/flutter_analyzer_plugin(all pass).dev/snippets(all pass).flutter analyze --flutter-repo(0 issues found).