Apply internally enabled lints (#816)

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`.
125 files changed
tree: 0b679cbd91943459b63b0e73ecda95046db7916e
  1. .github/
  2. api_benchmark/
  3. benchmarks/
  4. protobuf/
  5. protoc_plugin/
  6. tool/
  7. .gitignore
  8. analysis_options.yaml
  9. AUTHORS
  10. LICENSE
  11. mono_repo.yaml
  12. README.md
README.md

CI status

Protobuf support for Dart

Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.

This repository is home to packages related to protobuf for Dart.

PackageDescriptionPublished Version
protobufA support library for the generated codepub package
protoc_pluginA Dart back-end for the protoc compilerpub package
api_benchmarkBenchmarking for various API calls
query_benchmarkBenchmark for encoding and decoding of a “real-world” protobuf

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.