Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate aliases cause infinite recursion #95

Open
s3cur3 opened this issue Oct 7, 2024 · 1 comment
Open

Duplicate aliases cause infinite recursion #95

s3cur3 opened this issue Oct 7, 2024 · 1 comment

Comments

@s3cur3
Copy link
Contributor

s3cur3 commented Oct 7, 2024

Hi there! Thanks for a wonderfully useful tool. ☺️

While introducing Recode to a moderately large codebase, I found mix format would never terminate. When I added some debugging output, the Recode.Task.AliasOrder task seemed to be getting stuck on a handful of files, some of which were tests and others actual production code. After squinting at it for awhile, it looked like the common surprising feature between all of them was the presence of duplicate alias lines, like:

defmodule MyApp.MyModule do
  alias MyApp.Foo
  alias MyApp.Bar
  alias MyApp.Bar
  alias MyApp.Baz
end

Note that I did not have any issues running mix recode over the same files.

I'm not sure that the above is a sufficient minimal reproduction case, but I'll see if I can submit a patch in the next few days.

@NickNeck
Copy link
Member

NickNeck commented Oct 8, 2024

Thank you for reporting the issue. A patch is always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants