Repository navigation
Add trust gate flags for "flutter analyze" - #196415
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the --trust-plugins, --always-trust-plugins, and --never-trust-plugins flags to the analyze command, allowing users to control analyzer plugin execution trust. These flags are configured as mutually exclusive, and their values are forwarded to the Dart language server. On CI bots, plugins are now enabled by default unless --never-trust-plugins is specified. Additionally, integration and unit tests are added to verify this behavior. The review feedback identifies compilation errors in analyze_base.dart where argResults.flag is called, as the ArgResults class does not define a flag method, and suggests retrieving these values using bracket notation instead.
bkonyi
left a comment
There was a problem hiding this comment.
LGTM once merge conflicts are resolved :)
- Add missing `--client-id=flutter-analyze` expectations in `analyze_test.dart` and `analyze_continuously_test.dart` after merging flutter#197227. - Convert `expectServerArgs` parameters to named parameters and rename `botProcessManager` to `localProcessManager`. - Document the `null` behavior of `AnalysisServer.usePlugins`. - Split `--never-trust-plugins` into its own integration test with a fresh state directory, remove the redundant mutually-exclusive-flags integration test, inline the unused `pluginBody` parameter, and comment on `FLUTTER_HOST`. - Add `// [intended]` comments to skipped tests in `dev/integration_tests/windowing_test/test_driver/main_test.dart` surfaced by enabling `flutter_analyzer_plugin` on bots.
flutter/flutter@82ec424...43150a8 2026-11-27 [email protected] Windows: fix for popup descendent of popup closing the whole tree when the 2nd popup gains focus (flutter/flutter#196911) 2026-11-27 [email protected] Roll Skia from d693d85a4b77 to fe34f20b9689 (1 revision) (flutter/flutter#197491) 2026-11-27 [email protected] Roll Dart SDK from 691817e0ec3b to 5c3e102fc422 (1 revision) (flutter/flutter#197489) 2026-11-27 [email protected] Roll Fuchsia Linux SDK from 0bgCrr76CM4IqPO0v... to cBAjguERWwvY6tFtz... (flutter/flutter#197488) 2026-11-27 [email protected] [flutter_tools] Delete AppContext and legacy test context shims (flutter/flutter#197412) 2026-11-26 [email protected] Revert: [tool][engine] Enable experimental VM service by default (flutter/flutter#197481) 2026-11-26 [email protected] iOS: Remove engine includes from the platform views controller headers (flutter/flutter#197429) 2026-11-26 [email protected] [tool][engine] Enable experimental VM service by default (flutter/flutter#190100) 2026-11-26 [email protected] Add trust gate flags for "flutter analyze" (flutter/flutter#196415) 2026-11-26 [email protected] Roll Dart SDK from 7fcaf46b0308 to 691817e0ec3b (1 revision) (flutter/flutter#197475) 2026-11-26 [email protected] [Windows] Fix MASM flags in Windows GN `tool("asm")` (flutter/flutter#197464) 2026-11-26 [email protected] Roll Skia from cef5963c1bb2 to d693d85a4b77 (2 revisions) (flutter/flutter#197469) 2026-11-26 [email protected] Roll Packages from 105a874 to da586f5 (3 revisions) (flutter/flutter#197471) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] 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
Fixes https://github.com/flutter/dash-devexp-internal/issues/151
Recently the Dart SDK shipped similar changes, dart-lang/sdk@f7b03f3. So, in this change we mirror those.
flutter analyze(dart analyze)--trust-plugins. If plugin contents change, those new contents are, by default, not trusted.--always-trust-plugins.flutter analyzefinds untrusted plugins which are requested to run, it will print a message. This message can be suppressed with--never-trust-plugins.--plugins(runs all plugins).--no-pluginsremains the option to disable analyzer plugins.Pre-launch Checklist
///).