Skip to content

Migrate framework rules to analyzer plugin - #191035

Merged
auto-submit[bot] merged 14 commits into
flutter:masterfrom
bkonyi:migrate_framework_rules
Aug 13, 2026
Merged

auto-submit[bot] merged 14 commits into
flutter:masterfrom
bkonyi:migrate_framework_rules

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Migrates legacy string-based checks (verifyNoRuntimeTypeInToString and verifyNullInitializedDebugExpensiveFields) from dev/bots/analyze.dart to dev/flutter_analyzer_plugin to provide real-time IDE diagnostics and AST-based validation.

Changes

  • Added AST rules no_runtimetype_in_tostring and null_initialized_debug_expensive_fields.
  • Added unit tests in dev/flutter_analyzer_plugin/test/.
  • Enabled rules in packages/flutter/lib/analysis_options.yaml.
  • Removed legacy checks from dev/bots/analyze.dart.

@github-actions github-actions Bot added the framework flutter/packages/flutter repository. See also f: labels. label Aug 12, 2026
@bkonyi bkonyi added the CICD Run CI/CD label Aug 13, 2026
@bkonyi
bkonyi marked this pull request as ready for review August 13, 2026 14:38

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the custom no-runtime-type and null-fields validations from the legacy analyze.dart script into the flutter_analyzer_plugin as proper analyzer rules (NoRuntimeTypeInToString and NullInitializedDebugExpensiveFields). Feedback suggests adding public documentation to the new rule classes, ignoring runtimeType inside assertion statements to prevent false positives (along with adding a corresponding test case), and making the NullInitializedDebugExpensiveFields rule more robust by handling parenthesized or prefixed kDebugMode identifiers.

@github-actions github-actions Bot removed the framework flutter/packages/flutter repository. See also f: labels. label Aug 13, 2026
@bkonyi
bkonyi requested a review from srawlins August 13, 2026 17:28
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 13, 2026
Merged via the queue into flutter:master with commit 49b0955 Aug 13, 2026
22 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants