fix: :error consistency in remove_keyword_key and argument_equals? in Config.configure (#68)

This commit is contained in:
Igor Barakaiev 2024-08-04 01:50:44 +03:00 committed by GitHub
parent fa5f849928
commit e860b1f9d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -215,15 +215,15 @@ defmodule Igniter.Code.Keyword do
if Igniter.Code.Tuple.tuple?(item) do if Igniter.Code.Tuple.tuple?(item) do
case Igniter.Code.Tuple.tuple_elem(item, 0) do case Igniter.Code.Tuple.tuple_elem(item, 0) do
{:ok, first_elem} -> {:ok, first_elem} ->
Common.node_matches_pattern?(first_elem, ^key) Common.nodes_equal?(first_elem, key)
:error -> :error ->
false :error
end end
end end
end) do end) do
:error -> :error ->
{:ok, zipper} :error
{:ok, zipper} -> {:ok, zipper} ->
{:ok, zipper |> Zipper.remove()} {:ok, zipper |> Zipper.remove()}

View file

@ -400,8 +400,8 @@ defmodule Igniter.Project.Config do
:config, :config,
3, 3,
fn function_call -> fn function_call ->
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name) && Igniter.Code.Function.argument_equals?(function_call, 0, app_name) &&
Igniter.Code.Function.argument_matches_pattern?(function_call, 1, ^config_item) Igniter.Code.Function.argument_equals?(function_call, 1, config_item)
end end
) do ) do
:error -> :error ->
@ -418,8 +418,8 @@ defmodule Igniter.Project.Config do
:config, :config,
3, 3,
fn function_call -> fn function_call ->
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name) && Igniter.Code.Function.argument_equals?(function_call, 0, app_name) &&
(Igniter.Code.Function.argument_matches_pattern?(function_call, 1, ^config_item) || (Igniter.Code.Function.argument_equals?(function_call, 1, config_item) ||
Igniter.Code.Function.argument_matches_predicate?( Igniter.Code.Function.argument_matches_predicate?(
function_call, function_call,
1, 1,
@ -448,7 +448,7 @@ defmodule Igniter.Project.Config do
:config, :config,
2, 2,
fn function_call -> fn function_call ->
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name) Igniter.Code.Function.argument_equals?(function_call, 0, app_name)
end end
) do ) do
:error -> :error ->