Skip to content

Duplicate ignore must_be_immutable #795

Open
@putnokiabel

Description

@putnokiabel

At the start of the generated mock files, Mockito puts a // ignore_for_file: must_be_immutable directive.
For immutable classes Mockito additionally puts another // ignore: must_be_immutable.

This generates the following analyzer warning:

The diagnostic 'must_be_immutable' doesn't need to be ignored here because it's already being ignored.
Try removing the name from the list, or removing the whole comment if this is the only name in the list.
dart(duplicate_ignore)

Either the local ignore (for specific classes) or the global ignore (for the entire class) needs to be removed. It does not seem to matter which one, though keeping the global ignore for the entire file and removing the one specific to immutable classes seems to be the easier way that reduces complexity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-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