Skip to content

Migrate internal import rules to analyzer plugin - #191036

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

auto-submit[bot] merged 16 commits into
flutter:masterfrom
bkonyi:migrate_import_rules

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

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

Changes

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

@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. labels Aug 13, 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

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@bkonyi

bkonyi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 bad import verification checks for the flutter and flutter_tools packages from the legacy analyze.dart script to the flutter_analyzer_plugin as custom lint rules. Feedback highlights that this migration introduces a regression by omitting global validations like layer dependency, loop detection, and package structure verification. Additionally, the new lint rules need to be restricted to specific directories to prevent false positives in test and public export files, and the new public classes require proper documentation.

Comment thread dev/bots/analyze.dart
Comment thread dev/flutter_analyzer_plugin/lib/src/rules/no_bad_imports_in_flutter_tools.dart Outdated
Comment thread dev/flutter_analyzer_plugin/lib/src/rules/no_bad_imports_in_flutter_tools.dart Outdated
@github-actions github-actions Bot added the a: animation Animation APIs label Aug 13, 2026
@github-actions github-actions Bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 13, 2026
@bkonyi
bkonyi requested a review from srawlins August 13, 2026 17:17
srawlins
srawlins previously approved these changes Aug 13, 2026
Comment thread dev/flutter_analyzer_plugin/lib/src/rules/no_bad_imports_in_flutter_tools.dart Outdated
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit

auto-submit Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/191036, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants