Credo v1.5.0-rc.2 Credo.Check.Warning.ApplicationConfigInModuleAttribute View Source

This check has a base priority of high and works with any version of Elixir.

Explanation

Module attributes are evaluated at compile time and not at run time. As a result, certain configuration read calls made in your module attributes may work as expected during local development, but may break once in a deployed context.

This check analyzes all of the module attributes present within a module, and validates that there are no unsafe calls. Unsafe calls include:

As of Elixir 1.10 you can leverage Application.compile_env/3 and Application.compile_env!/2 if you wish to set configuration at compile time using module attributes.

Configuration parameters

There are no parameters for this check.

Link to this section Summary

Link to this section Functions

Link to this function

do_run_on_source_file(exec, source_file, params)

View Source