Skip to content

Analyzer plugin rule testing: When arguments mismatch parameters, or are wrong type, test hangs #61504

@srawlins

Description

@srawlins

You can parameterize lint rule messages with {0}, {1} today. (This will change with @stereotype441 's ongoing work, but for now...). Then when you report a diagnostic, the number of arguments must match the number of parameters. And the arguments must all be Strings. (Or maybe a few types like Strings and DartTypes...)

Today, if you get either of those things wrong, the test hangs and times out after 30 seconds. :/ Examples:

// Zero parameters:
static const LintCode code = LintCode('foo', 'Foo');

// One argument supplied:
rule.reportAtNode(node, arguments: [context.package!]);
// One parameter:
static const LintCode code = LintCode('foo', 'Foo {0}');

// Zero arguments supplied:
rule.reportAtNode(node);

and

// One parameter:
static const LintCode code = LintCode('foo', 'Foo {0}');

// One argument supplied, but it is not a String:
rule.reportAtNode(node, arguments: [context.package!]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-plugintype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions