-
Notifications
You must be signed in to change notification settings - Fork 162
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
Generated mocks should ignore deprecatedmember_use #565
Comments
I like this idea! In general, in my personal opinion, it would be great if Dart code generators would generate code with good support for restrictive Analyzer configuration. |
+1 Is there any updates? |
No updates |
Is there a workaround so this doesn't show up as a warning in a project, without having to edit generated code? |
copybara-service bot
pushed a commit
that referenced
this issue
Jul 14, 2023
People might want to mock classes that use some deprecated libraries or classes. Mocked class itself could also be deprecated. Deprecated member findings for the generated code are not very useful: 1. They are dubbing the finding in the actual code. 2. They are hard to disable (have to edit generated code). So disable `deprecated_member_use` and `deprecated_member_use_from_same_package` findings in the generated code. Fixes #565 PiperOrigin-RevId: 548076155
copybara-service bot
pushed a commit
that referenced
this issue
Jul 14, 2023
People might want to mock classes that use some deprecated libraries or classes. Mocked class itself could also be deprecated. Deprecated member findings for the generated code are not very useful: 1. They are dubbing the finding in the actual code. 2. They are hard to disable (have to edit generated code). So disable `deprecated_member_use` and `deprecated_member_use_from_same_package` findings in the generated code. Fixes #565 PiperOrigin-RevId: 548076155
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It can make sense to create a mock of a class that has deprecated members, uses deprecated libraries (with the class itself not being deprecated).
For example, I need to mock
PeopleResource
frompackage:googleapis/people/v1.dart
which uses deprecated fields in its implementation (although I'm not using any of them directly) and I'm getting the following analyzer warning that I can't get rid of:The text was updated successfully, but these errors were encountered: