Skip to content

Commit

Permalink
style: apply more quokka rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Feb 25, 2025
1 parent e858254 commit 0ba9123
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/protox/parse.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ defmodule Protox.Parse do

import Protox.Guards

alias Protox.{Definition, Field, MessageSchema, OneOf, Scalar}

alias Protox.Google.Protobuf.{
DescriptorProto,
FieldDescriptorProto,
Expand All @@ -17,6 +15,8 @@ defmodule Protox.Parse do
MessageOptions
}

alias Protox.{Definition, Field, MessageSchema, OneOf, Scalar}

@spec parse(binary(), Keyword.t()) :: {:ok, Definition.t()}
def parse(file_descriptor_set, opts \\ []) do
{:ok, descriptor} = FileDescriptorSet.decode(file_descriptor_set)
Expand Down
5 changes: 2 additions & 3 deletions test/support/random_init.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ defmodule Protox.RandomInit do
{:map, sub_msg} ->
val =
val
|> Enum.map(fn {k, msg_val} -> {k, generate_struct(sub_msg, msg_val)} end)
|> Map.new()
|> Map.new(fn {k, msg_val} -> {k, generate_struct(sub_msg, msg_val)} end)

[{field_name, val} | acc]

Expand Down Expand Up @@ -231,7 +230,7 @@ defmodule Protox.RandomInit do
defp get_gen(_depth, :unpacked, :double), do: list(gen_double())

defp get_gen(_depth, kind, {:enum, e}) when kind == :packed or kind == :unpacked do
list(e.constants() |> Map.new() |> Map.values() |> oneof())
e.constants() |> Map.new() |> Map.values() |> oneof() |> list()
end

defp get_gen(_depth, :unpacked, :string), do: list(utf8())
Expand Down

0 comments on commit 0ba9123

Please sign in to comment.