nilslice / protolock

Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
https://protolock.dev
BSD 3-Clause "New" or "Revised" License
600 stars 36 forks source link

Lock file does not record aggregate options with array values #117

Closed rmichela closed 5 years ago

rmichela commented 5 years ago

Reproduction

  1. Construct a message with a field with a compound option with an array value.
    message FloatIn { float val = 1 [(validate.rules).float = {in: [4.56, 7.89]}]; }
  2. Run protolock init
  3. Inspect proto.lock

Expected

Actual

nilslice commented 5 years ago

Thanks for reporting, @rmichela - do you have a fix in mind or had this just popped up and you're looking for help?

I believe @aroch provided this feature, so maybe if we ask nicely :smile: he can take a look! Otherwise, I will have to carve out some time next week to dig in.

rmichela commented 5 years ago

I don't have a fix in mind (yet). The issue came up while developing a protolock plugin for protoc-gen-validate, which makes heavy use of compound options.

aroch commented 5 years ago

You're correct, I did not support compound options. I started working on a fix, but will need a bit more time to finalise and create a PR.