Skip to content

Commit

Permalink
Avoid then/2
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Jan 8, 2024
1 parent ac39510 commit 84d1915
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/credo/check.ex
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ defmodule Credo.Check do
:tags
]

@__default_checks__ Code.eval_file(".credo.exs")
|> then(fn {config, _binding} -> config[:configs] end)
|> List.first()
|> then(fn %{:name => "default"} = config -> config[:checks][:enabled] end)
|> Enum.map(fn {check, _params} -> check end)
@__default_checks__ do
{config, _binding} = Code.eval_file(".credo.exs")
%{:name => "default", :checks => %{:enabled => check_tuples}} = List.first(config[:configs])

Enum.map(check_tuples, fn {check, _params} -> check end)
end

@doc false
defmacro __using__(opts) do
Expand Down

0 comments on commit 84d1915

Please sign in to comment.