Skip to content

[analyzer_testing] Allow testing code with dependencies #61597

@PiotrRogulski

Description

@PiotrRogulski

The AnalysisRuleTest class only allows testing isolated, standalone code snippets. However, many of our custom lint rules (provided in this package) depend on Flutter-based packages (for example, we check if a class is a HookWidget, or if an expression is equivalent to Alignment.center). Thus, to test the behavior of our lints, we need to write code that imports Flutter and possibly other packages — an example of such a test, written with custom_lint, is here: avoid_single_child_in_multi_child_widget_test.dart

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-plugintype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions