I find the compile time warnings very useful, but I can occasionally miss them, especially if it\'s on a pull request where the tests are running on a CI server.
Ide
In your mix.exs
:
def project do
[...,
aliases: aliases]
end
defp aliases do
["compile": ["compile --warnings-as-errors"]]
end
Then mix compile
will pass --warnings-as-errors
to the compile.elixir
subtask.
This also works for mix test
since it runs the compile
task implicitly.
If you don't add an alias, you can still run mix compile --warnings-as-errors
and it will do what you expect, but mix test --warnings-as-errors
will not do what you expect, since the flag does not reach the compile.elixir
task.