Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/src/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ class MockBuilder implements Builder {
'// ignore_for_file: invalid_use_of_visible_for_testing_member\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\n'));
b.body.add(Code('// ignore_for_file: unnecessary_parenthesis\n'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An aside for @srawlins – wonder if we should pull these ignores into a constant and DRY up this logic a bit...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do like having a comment for why each one might be needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could go in the constant definition, right?

Copy link
Member

@srawlins srawlins Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it could.

I do hope to eliminate all of these and replace with dart-lang/sdk#46957.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime, could we perhaps get this one merged? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the support just landed for "all lints", but it will be introduced in Dart 2.15, which is many moons from now.

// The generator appends a suffix to fake classes
b.body.add(Code('// ignore_for_file: camel_case_types\n\n'));
b.body.addAll(mockLibraryInfo.fakeClasses);
b.body.addAll(mockLibraryInfo.mockClasses);
});
Expand Down