Skip to content

Conversation

osa1
Copy link
Member

@osa1 osa1 commented Apr 13, 2023

This enables lints prefer_final_in_for_each and prefer_final_locals and fixes lints errors.

These lints were previously enabled in internal version in the following CLs:

  • cl/523340795: updated protoc_plugin source
  • cl/523340868: updated protoc_plugin tests
  • cl/523340813: updated protobuf source
  • cl/523952148: updated protobuf tests

Majority of the changes are generated by dart fix --apply. Manual changes were done in two places:

  • dart fix does not fix lints in <type> <var> = <expr>; syntax, it looks like it only replaces var with final and does not add final before a type. A few lint errors were fixed manually for this.

  • protoc_plugin/lib/src/client_generator.dart updated manually to fix the lints in generated code. The difference in generated code can be seen in changes in protoc_plugin/test/goldens.

This enables lints `prefer_final_in_for_each` and `prefer_final_locals` and
fixes lints errors.

These lints were previously enabled in internal version in the following CLs:

- cl/523340795: updated protoc_plugin source
- cl/523340868: updated protoc_plugin tests
- cl/523340813: updated protobuf source

protobuf tests are not yet updated internally.

Majority of the changes are generated by `dart fix --apply`. Manual changes
were done in two places:

- `dart fix` does not fix lints in `<type> <var> = <expr>;` syntax, it looks
  like it only replaces `var` with `final` and does not add `final` before a
  type. A few lint errors were fixed manually for this.

- protoc_plugin/lib/src/client_generator.dart updated manually to fix the lints
  in generated code. The difference in generated code can be seen in changes in
  `protoc_plugin/test/goldens`.
@osa1 osa1 requested review from devoncarew and natebosch April 13, 2023 08:09
@kevmoo
Copy link
Collaborator

kevmoo commented May 10, 2023

Can land @osa1 ?

@osa1 osa1 merged commit 05058a7 into google:master May 10, 2023
@osa1 osa1 deleted the lints branch May 10, 2023 06:54
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.

5 participants