diff --git a/.tool-versions b/.tool-versions index 0574c4be1..4aff4af89 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -erlang 26.1.2 -elixir 1.16.0-rc.0-otp-26 +erlang 24.0 +elixir 1.12.1-otp-24 \ No newline at end of file diff --git a/lib/credo/check/readability/nested_function_calls.ex b/lib/credo/check/readability/nested_function_calls.ex index 63bc24a6c..9bcc6318a 100644 --- a/lib/credo/check/readability/nested_function_calls.ex +++ b/lib/credo/check/readability/nested_function_calls.ex @@ -59,8 +59,13 @@ defmodule Credo.Check.Readability.NestedFunctionCalls do end # A fully qualified call with no arguments - defp traverse({{:., _meta, _call}, _meta2, []} = ast, accumulator, _issue) do - {ast, accumulator} + defp traverse({{:., _meta, _call}, _meta2, []} = ast, acc, _issue) do + {ast, acc} + end + + # We don't look into interpolations in strings/binaries + defp traverse({:<<>>, _meta, _args}, acc, _issue) do + {nil, acc} end # Any call @@ -252,13 +257,6 @@ defmodule Credo.Check.Readability.NestedFunctionCalls do ), do: true - # Kernel.to_string() in a string interpolation - def cannot_be_in_pipeline?( - {{:., _, [Kernel, :to_string]}, meta, _} = ast, - _excluded_functions, - _excluded_argument_types - ), do: meta[:from_interpolation] - # Elixir <= 1.8.0 # '__#{val}__' are compiled to String.to_charlist("__#{val}__") # we want to consider these charlists a valid pipe chain start