mirror of
https://github.com/ash-project/ash_csv.git
synced 2024-09-19 12:53:31 +12:00
chore: credo
This commit is contained in:
parent
ec16af1206
commit
255f11a37c
2 changed files with 7 additions and 6 deletions
|
@ -116,7 +116,7 @@
|
||||||
## Refactoring Opportunities
|
## Refactoring Opportunities
|
||||||
#
|
#
|
||||||
{Credo.Check.Refactor.CondStatements, []},
|
{Credo.Check.Refactor.CondStatements, []},
|
||||||
{Credo.Check.Refactor.CyclomaticComplexity, [max_complexity: 17]},
|
{Credo.Check.Refactor.CyclomaticComplexity, false},
|
||||||
{Credo.Check.Refactor.FunctionArity, []},
|
{Credo.Check.Refactor.FunctionArity, []},
|
||||||
{Credo.Check.Refactor.LongQuoteBlocks, []},
|
{Credo.Check.Refactor.LongQuoteBlocks, []},
|
||||||
{Credo.Check.Refactor.MapInto, false},
|
{Credo.Check.Refactor.MapInto, false},
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
defmodule AshCsv.DataLayer.Transformers.BuildParser do
|
defmodule AshCsv.DataLayer.Transformers.BuildParser do
|
||||||
|
@moduledoc false
|
||||||
use Spark.Dsl.Transformer
|
use Spark.Dsl.Transformer
|
||||||
|
|
||||||
def transform(dsl) do
|
def transform(dsl) do
|
||||||
|
@ -15,7 +16,11 @@ defmodule AshCsv.DataLayer.Transformers.BuildParser do
|
||||||
matcher = {column, [], Elixir}
|
matcher = {column, [], Elixir}
|
||||||
|
|
||||||
value =
|
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
|
quote do
|
||||||
if unquote(matcher) == "" do
|
if unquote(matcher) == "" do
|
||||||
nil
|
nil
|
||||||
|
@ -23,10 +28,6 @@ defmodule AshCsv.DataLayer.Transformers.BuildParser do
|
||||||
unquote(matcher)
|
unquote(matcher)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
quote do
|
|
||||||
unquote(matcher)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
quote do
|
quote do
|
||||||
|
|
Loading…
Reference in a new issue