grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
861 stars 271 forks source link

.pb.dart constructors generated with no_leading_underscores_for_local_identifiers warning #562

Closed eseidel closed 2 years ago

eseidel commented 2 years ago

This is a lint from the default package:lints. Clearly grpc tries to avoid other lints, seems easy to add this one to the ignore list?

analysis_options.yaml: include: package:lints/recommended.yaml

syntax = "proto3";

package input;

message PositionProto {
  int32 x = 1;
  int32 y = 2;
}
  PositionProto._() : super();
  factory PositionProto({
    $core.int? x,
    $core.int? y,
  }) {
    final _result = create();
    if (x != null) {
      _result.x = x;
    }
    if (y != null) {
      _result.y = y;
    }
    return _result;
  }
[{
    "resource": "/c:/Users/micro/Documents/GitHub/shimmer/packages/shimmer_shared/lib/src/generated/input.pb.dart",
    "owner": "_generated_diagnostic_collection_name_#1",
    "code": {
        "value": "no_leading_underscores_for_local_identifiers",
        "target": {
            "$mid": 1,
            "external": "https://dart-lang.github.io/linter/lints/no_leading_underscores_for_local_identifiers.html",
            "path": "/linter/lints/no_leading_underscores_for_local_identifiers.html",
            "scheme": "https",
            "authority": "dart-lang.github.io"
        }
    },
    "severity": 2,
    "message": "Avoid leading underscores for local identifiers.",
    "source": "dart",
    "startLineNumber": 24,
    "startColumn": 11,
    "endLineNumber": 24,
    "endColumn": 18
}]
mraleph commented 2 years ago

This is tracked by https://github.com/google/protobuf.dart/issues/682 (this code is generated by protoc plugin).