Skip to content

Commit

Permalink
chore: credo
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed May 6, 2024
1 parent ec16af1 commit 255f11a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
11 changes: 6 additions & 5 deletions lib/ash_csv/data_layer/transformers/build_parser.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule AshCsv.DataLayer.Transformers.BuildParser do
@moduledoc false
use Spark.Dsl.Transformer

def transform(dsl) do
Expand All @@ -15,18 +16,18 @@ 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
else
unquote(matcher)
end
end
else
quote do
unquote(matcher)
end
end

quote do
Expand Down

0 comments on commit 255f11a

Please sign in to comment.