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
case Igniter.Code.Tuple.tuple_elem(item, 0) do
{:ok, first_elem} ->
Common.node_matches_pattern?(first_elem, ^key)
Common.nodes_equal?(first_elem, key)
:error ->
false
:error
end
end
end) do
:error ->
{:ok, zipper}
:error
{:ok, zipper} ->
{:ok, zipper |> Zipper.remove()}

View file

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