Handling Warnings as Errors in Elixir Compilation and Tests for CI

85
clicks
Handling Warnings as Errors in Elixir Compilation and Tests for CI

Source: dashbit.co

Type: Post

Wojtek Mach discusses the importance of treating warnings as errors in Elixir projects to avoid committing code that might cause issues later. The post walks through enabling the `--warnings-as-errors` option during the compilation process using `mix compile` and ensuring continuous integration (CI) systems like GitHub Actions catch these warnings by adjusting the workflow configuration. Wojtek also addresses how to manage warnings within test files by configuring `test/test_helper.exs` or using newer options available in Elixir v1.12+. These practices help keep Elixir projects clean and free from potentially problematic code.

© HashMerge 2024