I’d like to get compiler warnings as errors in my tests, because in my experience, such warnings quite often uncover real bugs.
What I’ve tried before:
- alias configuration in
mix.exs
, which exactly I forgot test_elixirc_options: [warnings_as_errors: true, docs: false, debug_info: false]
inproject/0
inmix.exs
, which looks like the correct thing to do, but did not have the desired effect.
By desired effect I mean that not only I want such warnings to be shown, but to cause an exit with a non-zero exit status.
This looks highly relevant: elixir/lib/mix/lib/mix/tasks/test.ex at v1.17.0 · elixir-lang/elixir · GitHub
The documentation some lines above suggests
https://github.com/elixir-lang/elixir/blob/v1.17.0/lib/mix/lib/mix/tasks/test.ex#L210C11-L210C87
which does not work for me.