Skip to content

Commit 0422551

Browse files
oprypincopybara-github
authored andcommitted
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. PiperOrigin-RevId: 597233416
1 parent e15e000 commit 0422551

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 5.4.5-wip
2+
3+
* Ignore "must_be_immutable" warning in generated files. Mocks cannot be made
4+
immutable anyway, but this way users aren't prevented from using generated
5+
mocks altogether.
6+
17
## 5.4.4
28

39
* Use `posix` style for local imports.

lib/src/builder.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class MockBuilder implements Builder {
123123
// example.
124124
b.body.add(Code(
125125
'// ignore_for_file: invalid_use_of_visible_for_testing_member\n'));
126+
b.body.add(Code('// ignore_for_file: must_be_immutable\n'));
126127
b.body.add(Code('// ignore_for_file: prefer_const_constructors\n'));
127128
// The code_builder `asA` API unconditionally adds defensive parentheses.
128129
b.body.add(Code('// ignore_for_file: unnecessary_parenthesis\n'));

0 commit comments

Comments
 (0)