CodeStyle.Check.Warning.EnvironmentVariableAccess (code_style v0.2.0)

Copy Markdown View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

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

Explanation

OS environment access belongs in the configuration boundary, not application source.

Calls to System.get_env/0,1 and System.fetch_env!/1 are allowed from config/, where runtime configuration is assembled, and are reported from lib/ application source.

Application code should consume application configuration rather than read the operating-system environment directly.

Check-Specific Parameters

There are no specific parameters for this check.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.