Hi all,
In CI setups it's quite common to see the `--warnings-as-errors` applied when compiling and even when running tests (since 1.12). I'm proposing the addition of this option also to Ecto.Migrator, so that warnings in migrations can be picked up and prevent the execution of migrations.
Currently, to set this up I believe involves either writing a custom Credo check or write an Elixir module in `/priv/repo/migrations` and have it call Code.compile_module or similar while capturing the output that gets sent to stderr. This last option also involves changing elixirc_paths and/or using a new custom MIX_ENV to do it. Both alternatives I can see add complexity to the project and are not easily accomplished by people new to the language given the lack of documentation around this use case.
I believe it makes sense to have a mechanism of scanning migrations for warnings even if the --warnings-as-errors option is not the best way to have it.
So does it make sense to have this option added? I'm willing to do the work required to get this merged, with some guidance of course, as long as the Ecto team sees value in it.
Thanks,
Gonçalo Tomás