Skip to content

Commit 9b074b7

Browse files
authored
Remove dart_format dep, formatting grpc files (#702)
1 parent 785ad74 commit 9b074b7

File tree

4 files changed

+14
-29
lines changed

4 files changed

+14
-29
lines changed

protoc_plugin/lib/protoc.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'dart:convert';
22

3-
import 'package:dart_style/dart_style.dart';
43
import 'package:protobuf/protobuf.dart';
54

65
import 'const_generator.dart' show writeJsonConst;

protoc_plugin/lib/src/file_generator.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
part of '../protoc.dart';
66

77
final _dartIdentifier = RegExp(r'^\w+$');
8-
final _formatter = DartFormatter();
98
const String _convertImportPrefix = r'$convert';
109

1110
const String _fixnumImportPrefix = r'$fixnum';
@@ -527,7 +526,7 @@ class FileGenerator extends ProtobufContainer {
527526
generator.generate(out);
528527
}
529528

530-
return _formatter.format(out.toString());
529+
return out.toString();
531530
}
532531

533532
void writeBinaryDescriptor(IndentingWriter out, String identifierName,

protoc_plugin/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
fixnum: ^1.0.0
1111
path: ^1.8.0
1212
protobuf: ^2.0.0
13-
dart_style: ^2.0.0
1413

1514
dev_dependencies:
1615
test: ^1.16.0

protoc_plugin/test/goldens/grpc_service.pbgrpc

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,22 @@ class TestClient extends $grpc.Client {
3434
TestClient($grpc.ClientChannel channel,
3535
{$grpc.CallOptions? options,
3636
$core.Iterable<$grpc.ClientInterceptor>? interceptors})
37-
: super(channel, options: options, interceptors: interceptors);
37+
: super(channel, options: options,
38+
interceptors: interceptors);
3839

39-
$grpc.ResponseFuture<$0.Output> unary($0.Input request,
40-
{$grpc.CallOptions? options}) {
40+
$grpc.ResponseFuture<$0.Output> unary($0.Input request, {$grpc.CallOptions? options}) {
4141
return $createUnaryCall(_$unary, request, options: options);
4242
}
4343

44-
$grpc.ResponseFuture<$0.Output> clientStreaming(
45-
$async.Stream<$0.Input> request,
46-
{$grpc.CallOptions? options}) {
47-
return $createStreamingCall(_$clientStreaming, request, options: options)
48-
.single;
44+
$grpc.ResponseFuture<$0.Output> clientStreaming($async.Stream<$0.Input> request, {$grpc.CallOptions? options}) {
45+
return $createStreamingCall(_$clientStreaming, request, options: options).single;
4946
}
5047

51-
$grpc.ResponseStream<$0.Output> serverStreaming($0.Input request,
52-
{$grpc.CallOptions? options}) {
53-
return $createStreamingCall(
54-
_$serverStreaming, $async.Stream.fromIterable([request]),
55-
options: options);
48+
$grpc.ResponseStream<$0.Output> serverStreaming($0.Input request, {$grpc.CallOptions? options}) {
49+
return $createStreamingCall(_$serverStreaming, $async.Stream.fromIterable([request]), options: options);
5650
}
5751

58-
$grpc.ResponseStream<$0.Output> bidirectional($async.Stream<$0.Input> request,
59-
{$grpc.CallOptions? options}) {
52+
$grpc.ResponseStream<$0.Output> bidirectional($async.Stream<$0.Input> request, {$grpc.CallOptions? options}) {
6053
return $createStreamingCall(_$bidirectional, request, options: options);
6154
}
6255
}
@@ -95,21 +88,16 @@ abstract class TestServiceBase extends $grpc.Service {
9588
($0.Output value) => value.writeToBuffer()));
9689
}
9790

98-
$async.Future<$0.Output> unary_Pre(
99-
$grpc.ServiceCall call, $async.Future<$0.Input> request) async {
91+
$async.Future<$0.Output> unary_Pre($grpc.ServiceCall call, $async.Future<$0.Input> request) async {
10092
return unary(call, await request);
10193
}
10294

103-
$async.Stream<$0.Output> serverStreaming_Pre(
104-
$grpc.ServiceCall call, $async.Future<$0.Input> request) async* {
95+
$async.Stream<$0.Output> serverStreaming_Pre($grpc.ServiceCall call, $async.Future<$0.Input> request) async* {
10596
yield* serverStreaming(call, await request);
10697
}
10798

10899
$async.Future<$0.Output> unary($grpc.ServiceCall call, $0.Input request);
109-
$async.Future<$0.Output> clientStreaming(
110-
$grpc.ServiceCall call, $async.Stream<$0.Input> request);
111-
$async.Stream<$0.Output> serverStreaming(
112-
$grpc.ServiceCall call, $0.Input request);
113-
$async.Stream<$0.Output> bidirectional(
114-
$grpc.ServiceCall call, $async.Stream<$0.Input> request);
100+
$async.Future<$0.Output> clientStreaming($grpc.ServiceCall call, $async.Stream<$0.Input> request);
101+
$async.Stream<$0.Output> serverStreaming($grpc.ServiceCall call, $0.Input request);
102+
$async.Stream<$0.Output> bidirectional($grpc.ServiceCall call, $async.Stream<$0.Input> request);
115103
}

0 commit comments

Comments
 (0)