Skip to content
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

Ignore implicit_dynamic_parameter in generated code #604

Closed
wants to merge 4 commits into from
Closed

Ignore implicit_dynamic_parameter in generated code #604

wants to merge 4 commits into from

Conversation

MisterJimson
Copy link
Contributor

@MisterJimson MisterJimson commented Feb 13, 2020

Done and looking for feedback on

Need advisement

  • Updating tests. I have fixed 1 test out of ~40 that fail because the expected output is no longer correct. I'm happy to update them (see the one I updated), but I am wondering if we would prefer to do a contains check instead of an exact match check (which would make all these tests pass without having to update the expected outputs). Or if the inner test code should strip out the warning before comparing. May want to consider future lints we need to disable (NNDB as one example, other Strong Mode stuff, etc)

@MisterJimson MisterJimson changed the title 557 implicit dynamic Ignore implicit_dynamic_parameter in generated code Feb 13, 2020
Copy link
Collaborator

@kevmoo kevmoo left a comment

Choose a reason for hiding this comment

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

I want to approve this, but we are really blocked on dart-lang/source_gen#370

This would also handle having to add all of the bits to each generator

Please 👍 dart-lang/source_gen#370


/// Comment to disable analysis errors not currently supported in generated
/// output. Added to the top of all generated files.
const ignoredWarningsComment = '// ignore_for_file: implicit_dynamic_parameter';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Put this in json_serializable_generator and make it private!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@MisterJimson
Copy link
Contributor Author

MisterJimson commented Feb 14, 2020

I don’t see it as a blocker. The ignore comment only gets added once in the file no matter how many classes you annotate in the file.

That issue would improve the implementation, but tons of libraries add ignore_for_file to generated output as is.

kevmoo added a commit that referenced this pull request Feb 18, 2020
If provided, the builders for JSON serialization and literals will include
`// ignore_for_file:`` entries in generated files.

Fixes #557
Closes #604
@kevmoo
Copy link
Collaborator

kevmoo commented Feb 18, 2020

See #608

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.

Generate code that supports implicit-dynamic: false
2 participants