diff --git a/lib/credo/check.ex b/lib/credo/check.ex index 846a84f92..292fadf41 100644 --- a/lib/credo/check.ex +++ b/lib/credo/check.ex @@ -457,11 +457,7 @@ defmodule Credo.Check do defoverridable Credo.Check - defp append_issues_and_timings([] = _issues, exec) do - exec - end - - defp append_issues_and_timings([_ | _] = issues, exec) do + defp append_issues_and_timings(issues, exec) do Credo.Execution.ExecutionIssues.append(exec, issues) end end diff --git a/lib/credo/execution/execution_issues.ex b/lib/credo/execution/execution_issues.ex index 0b9ab32fe..c885983dd 100644 --- a/lib/credo/execution/execution_issues.ex +++ b/lib/credo/execution/execution_issues.ex @@ -14,6 +14,8 @@ defmodule Credo.Execution.ExecutionIssues do end @doc "Appends an `issue` for the specified `filename`." + def append(_, [] = _issues), do: :ok + def append(%Execution{issues_pid: pid}, issues) when is_list(issues) do issues |> Enum.group_by(& &1.filename)