Skip to content

Commit 4ad9deb

Browse files
authored
Merge pull request stackb#306 from stackb/pcj/protoc-gen-ts-proto-m-update
Update M option syntax for ts-proto 1.136.1
2 parents aa380e4 + 7a1558e commit 4ad9deb

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pkg/plugin/stephenh/ts-proto/protoc-gen-ts-proto.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ func (p *ProtocGenTsProto) Configure(ctx *protoc.PluginContext) *protoc.PluginCo
3535
var emitImportedFiles bool
3636
var options []string
3737
for _, option := range ctx.PluginConfig.GetOptions() {
38-
// options may be configured to include many "M=" options, but only
38+
// options may be configured to include many "M" options, but only
3939
// include the relevant ones to avoid BUILD file clutter.
40-
if strings.HasPrefix(option, "M=") {
41-
keyVal := option[len("M="):]
40+
if strings.HasPrefix(option, "M") {
41+
keyVal := option[len("M"):]
4242
parts := strings.SplitN(keyVal, "=", 2)
4343
filename := parts[0]
4444
if !imports[filename] {

pkg/plugin/stephenh/ts-proto/protoc-gen-ts-proto_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestProtocGenTsProtoPlugin(t *testing.T) {
3434
),
3535
SkipIntegration: true,
3636
},
37-
"includes only relevant M= options": {
37+
"includes only relevant M options": {
3838
Input: `
3939
syntax = "proto3";
4040
@@ -47,19 +47,19 @@ message M {}
4747
`,
4848
Directives: plugintest.WithDirectives(
4949
"proto_plugin", "protoc-gen-ts-proto implementation stephenh:ts-proto:protoc-gen-ts-proto",
50-
"proto_plugin", "protoc-gen-ts-proto option M=google/protobuf/empty.proto=./external/protobufapis/google/protobuf/empty",
51-
"proto_plugin", "protoc-gen-ts-proto option M=google/protobuf/timestamp.proto=./external/protobufapis/google/protobuf/timestamp",
52-
"proto_plugin", "protoc-gen-ts-proto option M=google/protobuf/duration.proto=./external/protobufapis/google/protobuf/duration",
53-
"proto_plugin", "protoc-gen-ts-proto option M=google/type/timeofday.proto=./external/googleapis/google/type/timeofday",
54-
"proto_plugin", "protoc-gen-ts-proto option M=google/type/datetime.proto=./external/googleapis/google/type/datetime",
50+
"proto_plugin", "protoc-gen-ts-proto option Mgoogle/protobuf/empty.proto=./external/protobufapis/google/protobuf/empty",
51+
"proto_plugin", "protoc-gen-ts-proto option Mgoogle/protobuf/timestamp.proto=./external/protobufapis/google/protobuf/timestamp",
52+
"proto_plugin", "protoc-gen-ts-proto option Mgoogle/protobuf/duration.proto=./external/protobufapis/google/protobuf/duration",
53+
"proto_plugin", "protoc-gen-ts-proto option Mgoogle/type/timeofday.proto=./external/googleapis/google/type/timeofday",
54+
"proto_plugin", "protoc-gen-ts-proto option Mgoogle/type/datetime.proto=./external/googleapis/google/type/datetime",
5555
),
5656
PluginName: "protoc-gen-ts-proto",
5757
Configuration: plugintest.WithConfiguration(
5858
plugintest.WithLabel(t, "@build_stack_rules_proto//plugin/stephenh/ts-proto:protoc-gen-ts-proto"),
5959
plugintest.WithOutputs("test.ts"),
6060
plugintest.WithOptions(
61-
"M=google/protobuf/duration.proto=./external/protobufapis/google/protobuf/duration",
62-
"M=google/type/datetime.proto=./external/googleapis/google/type/datetime",
61+
"Mgoogle/protobuf/duration.proto=./external/protobufapis/google/protobuf/duration",
62+
"Mgoogle/type/datetime.proto=./external/googleapis/google/type/datetime",
6363
),
6464
),
6565
SkipIntegration: true,

0 commit comments

Comments
 (0)