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

Update code generator to pass lints-2.0.0 recommended lints #682

Closed
osa1 opened this issue Jun 20, 2022 · 1 comment
Closed

Update code generator to pass lints-2.0.0 recommended lints #682

osa1 opened this issue Jun 20, 2022 · 1 comment

Comments

@osa1
Copy link
Member

osa1 commented Jun 20, 2022

lints-2.0.0 enables a few new lints, and currently code we generate does not follow no_leading_underscores_for_local_identifiers as we generate _result in message factory methods.

Fix should be as easy as renaming the variable to $_result. We can't rename it to anything that could be a Dart identifier for a proto field (e.g. result) as that will cause shadowing in the method body.

We should also update protobuf and protoc_plugin lints deps to 2.0. If we do that then we will start checking generated files for lints-2.0 as we run dart analyze after generating protos in CI.

@osa1
Copy link
Member Author

osa1 commented Aug 2, 2022

With #703 we no longer generate the _result variable and generated files pass lints-2.0.0 recommended lints.

See protoc_plugin changelog for how to migrate your code for #703, which is a breaking change.

@osa1 osa1 closed this as completed Aug 2, 2022
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

No branches or pull requests

1 participant