From 255f11a37ca1a207345da2e71559fbca4c829a71 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 6 May 2024 18:53:31 -0400 Subject: [PATCH] chore: credo --- .credo.exs | 2 +- lib/ash_csv/data_layer/transformers/build_parser.ex | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.credo.exs b/.credo.exs index 9772624..1fe9d48 100644 --- a/.credo.exs +++ b/.credo.exs @@ -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}, diff --git a/lib/ash_csv/data_layer/transformers/build_parser.ex b/lib/ash_csv/data_layer/transformers/build_parser.ex index 4b5d1a6..097dd9d 100644 --- a/lib/ash_csv/data_layer/transformers/build_parser.ex +++ b/lib/ash_csv/data_layer/transformers/build_parser.ex @@ -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