chore: credo

This commit is contained in:
Zach Daniel 2024-05-06 18:53:31 -04:00
parent ec16af1206
commit 255f11a37c
2 changed files with 7 additions and 6 deletions

View file

@ -116,7 +116,7 @@
## Refactoring Opportunities
#
{Credo.Check.Refactor.CondStatements, []},
{Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 17]},
{Credo.Check.Refactor.CyclomaticComplexity, false},
{Credo.Check.Refactor.FunctionArity, []},
{Credo.Check.Refactor.LongQuoteBlocks, []},
{Credo.Check.Refactor.MapInto, false},

View file

@ -1,4 +1,5 @@
defmodule AshCsv.DataLayer.Transformers.BuildParser do
@moduledoc false
use Spark.Dsl.Transformer
def transform(dsl) do
@ -15,7 +16,11 @@ defmodule AshCsv.DataLayer.Transformers.BuildParser do
matcher = {column, [], Elixir}
value =
if Ash.Type.ecto_type(attribute.type) not in [:string, :uuid, :binary_id] do
if Ash.Type.ecto_type(attribute.type) in [:string, :uuid, :binary_id] do
quote do
unquote(matcher)
end
else
quote do
if unquote(matcher) == "" do
nil
@ -23,10 +28,6 @@ defmodule AshCsv.DataLayer.Transformers.BuildParser do
unquote(matcher)
end
end
else
quote do
unquote(matcher)
end
end
quote do