It sounds like you are calling a function like this:
defmodule Mix.Tasks.Deploy do
use Mix.Task
def run(_) do
# doing really cool stuff
# ...
Comeonin.Argon2.hashpwsalt("some password")
# ...
# more cool stuff
end
end
What credo is suggesting is to do something like this:
defmodule Mix.Tasks.Deploy do
use Mix.Task
alias Comeonin.Argon2
def run(_) do
# best programming you have ever seen
# ...
Argon2.hashpwsalt("bestpassword")
# ...
# more cool programming
end
end
So, credo is complaining that you are calling a function with nested module names, Comeonin.Argon2.hashpwsalt/1, for example. It wants you to call a function with a singular module name, like Argon2.hashpwsalt/1. So you can use alias for this purpose. The cool think about alias is that it is lexically scoped. This means you can use it within a function
if you need.


















