Skip to content

✨ Fix: Remove redundant // ignore: must_be_immutable in generated mocks #809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stephanebalasse
Copy link

This PR addresses issue #795 by removing the redundant // ignore: must_be_immutable from generated mock files.

Since the directive // ignore_for_file: must_be_immutable is already present at the top of the generated files, the additional per-class // ignore: must_be_immutable is unnecessary and causes a dart(duplicate_ignore) warning.

What this PR does:

Keeps the global ignore directive (ignore_for_file)

Removes the redundant local ignore directives added for immutable classes

Removes the existing test that was checking for the presence of the local directive

This change simplifies the generated code and prevents analyzer warnings related to duplicate ignores.

The 'must_be_immutable' ignore comment was unnecessary and has been removed. This streamlines the code by eliminating an unused conditional block, maintaining cleaner and more focused logic.
This variable was declared but never used, causing unnecessary clutter in the code. Removing it improves code readability and maintains cleaner logic in the builder.
The removed test for adding `ignore: must_be_immutable` comments is no longer necessary. It likely reflects obsolete functionality or has been integrated elsewhere in the codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant