Skip to content

Commit

Permalink
Ignore "must_be_immutable" warning in generated files.
Browse files Browse the repository at this point in the history
Mocks cannot be made immutable anyway, but this way users aren't prevented from using generated mocks altogether.

PiperOrigin-RevId: 597233416
  • Loading branch information
oprypin authored and copybara-github committed Jan 10, 2024
1 parent e15e000 commit 0422551
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 5.4.5-wip

* Ignore "must_be_immutable" warning in generated files. Mocks cannot be made
immutable anyway, but this way users aren't prevented from using generated
mocks altogether.

## 5.4.4

* Use `posix` style for local imports.
Expand Down
1 change: 1 addition & 0 deletions lib/src/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class MockBuilder implements Builder {
// example.
b.body.add(Code(
'// ignore_for_file: invalid_use_of_visible_for_testing_member\n'));
b.body.add(Code('// ignore_for_file: must_be_immutable\n'));
b.body.add(Code('// ignore_for_file: prefer_const_constructors\n'));
// The code_builder `asA` API unconditionally adds defensive parentheses.
b.body.add(Code('// ignore_for_file: unnecessary_parenthesis\n'));
Expand Down

0 comments on commit 0422551

Please sign in to comment.