Skip to content

Commit c32e6d6

Browse files
committed
chore: fix arity option
1 parent c5f35c4 commit c32e6d6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/igniter/refactors/rename.ex

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ defmodule Igniter.Refactors.Rename do
2323
def rename_function(igniter, old, new, opts \\ [])
2424

2525
def rename_function(igniter, {old_module, old_function}, {new_module, new_function}, opts) do
26+
opts = Keyword.put(opts, :arity, opts[:arity] || :any)
27+
2628
Igniter.update_all_elixir_files(igniter, fn zipper ->
2729
Enum.reduce(List.wrap(opts[:arity]), {:ok, zipper}, fn arity, {:ok, zipper} ->
2830
with {:ok, zipper} <-

test/igniter/refactors/renames_test.exs

+1-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ defmodule Igniter.Refactors.RenameTest do
111111
|> apply_igniter!()
112112
|> Igniter.Refactors.Rename.rename_function(
113113
{Example, :some_function},
114-
{Example, :some_other_function},
115-
arity: 0
114+
{Example, :some_other_function}
116115
)
117116
|> assert_content_equals("lib/example.ex", """
118117
defmodule Example do

0 commit comments

Comments
 (0)