Skip to content

Ensure evaluating constants #58478

Closed
Closed
@asashour

Description

@asashour

Some rules are missing constant evaluation, e.g. #58470

How about if we have a test, which iterates over all rule tests, and ensures there is a corresponding constant usage for any of 0, 1 and -1?

For example, the following is a test in literal_only_boolean_expressions

if (1 < 0 && true) {} // LINT

The test ensures there is also (which is currently failing)

if (one < zero && true) {} // LINT

Having the FAILING feature would ease adding failing tests, to be fixed at a later stage.

Or would it be too aggressive to do it for all the lints?

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.legacy-area-analyzerUse area-devexp instead.type-code-healthInternal changes to our tools and workflows to make them cleaner, simpler, or more maintainabletype-enhancementA request for a change that isn't a bugtype-test

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions