Identifying Deprecated Regex Usage in Elixir with Credo

32
clicks
Identifying Deprecated Regex Usage in Elixir with Credo

Source: geekmonkey.org

Type: Post

The content discusses a significant change introduced in Elixir 1.19, where storing regular expressions in module attributes is deprecated due to changes in Erlang/OTP 28. It emphasizes the importance for teams managing large Elixir codebases to identify and update deprecated usages before upgrading. The article explains how to create a custom Credo rule to scan for these deprecated regex module attributes effectively. It demonstrates the process of traversing the AST to find and warn about such usages and provides examples of how to configure and use the custom check in a project. Overall, it underscores the necessity of adapting codebases for compliance with the upcoming changes in Elixir and suggests that automated checks can facilitate a smoother transition.

© HashMerge 2025