-
Notifications
You must be signed in to change notification settings - Fork 414
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
Multi alias use is not detected #54
Comments
Hi Aaron, maybe you mistyped your example, but that is not how you use aliasing. An alias is used to reference a given module by another (shorter) name, which is by default the last part of the module atom. Your
Was this a typo in your example or did I misinterpret the report? In any case, thanks for reporting! 👍 |
Yes, you are correct. I messed up the sample. I corrected the sample that way it's obvious. Also, what I just discovered while updating it is that this works |
Doing some more digging into it and it appears that this may be the preferred syntax and it currently does get through the current checks. defmodule Sample.App do
@moduledoc false
alias Sample.{App.One, App.Two} # <----
def foo do
{One.one, Two.two}
end
end |
|
Looks good. |
Elixir 1.2 added support for multi use aliases. Credo should pick this up and not warn on missing aliases.
Here is an example that should be allowed and not have any warnings.
However, this will give the following messages
The text was updated successfully, but these errors were encountered: