Sitelet https://github.com/flutter/flutter/pull/191124
Skip to content

[analysis] Migrate verifyNoTestImports to flutter_analyzer_plugin - #191124

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

auto-submit[bot] merged 4 commits into
flutter:masterfrom
bkonyi:migrate_no_test_imports_rule

Conversation

@bkonyi

@bkonyi bkonyi commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Migrates verifyNoTestImports from dev/bots/analyze.dart to an AST-based AnalysisRule (NoTestImports) in dev/flutter_analyzer_plugin.

Changes

  • Implements NoTestImports in dev/flutter_analyzer_plugin/lib/src/rules/no_test_imports.dart.
  • Adds reflective unit tests in dev/flutter_analyzer_plugin/test/no_test_imports_test.dart.
  • Registers NoTestImports in dev/flutter_analyzer_plugin/lib/main.dart.
  • Removes verifyNoTestImports and 'no-test-imports' from dev/bots/analyze.dart.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 14, 2026
@bkonyi
bkonyi force-pushed the migrate_no_test_imports_rule branch from 6f00053 to 77bbc15 Compare August 14, 2026 16:35

@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 'no test imports' validation from the custom analyzer script (dev/bots/analyze.dart) to a formal analyzer plugin rule (NoTestImports) within dev/flutter_analyzer_plugin. Feedback suggests rephrasing the diagnostic message of the new rule to be clearer when displayed inline, and adding documentation to the public code member to comply with the repository style guide.

Comment thread dev/flutter_analyzer_plugin/lib/src/rules/no_test_imports.dart
@bkonyi
bkonyi force-pushed the migrate_no_test_imports_rule branch from 77bbc15 to 886ebb9 Compare August 14, 2026 16:36
@bkonyi
bkonyi force-pushed the migrate_no_test_imports_rule branch from 886ebb9 to 44acc73 Compare August 14, 2026 16:37
@bkonyi
bkonyi requested a review from srawlins August 14, 2026 19:42

const Set<String> _exemptTestImports = <String>{
'package:flutter_test/flutter_test.dart',
'hit_test.dart',

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.

Lol the beauty of writing bespoke lint rules for a specific codebase. No hand-wringing over little exceptions like this.

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