Skip to content

Commit

Permalink
Fix recommended conformance test by reinstating fields ordering
Browse files Browse the repository at this point in the history
Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput
  • Loading branch information
ahamez committed Jun 16, 2020
1 parent c8a104b commit 34cc0f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/protox/define.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ defmodule Protox.Define do
# credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity
defp define_messages(messages) do
for {msg_name, syntax, fields} <- messages do
fields = Enum.sort(fields, &(elem(&1, 0) < elem(&2, 0)))
unknown_fields = make_unknown_fields(:__uf__, fields)
struct_fields = make_struct_fields(fields, unknown_fields, syntax)
required_fields = make_required_fields(fields)
Expand Down

0 comments on commit 34cc0f6

Please sign in to comment.