Ambient.Credo.NoDirectEnv (Ambient v0.1.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

Direct environment reads bypass the env test override, and System.put_env/2 mutates the whole VM – concurrent async: true tests clobber each other and values leak into later tests. Route through your env wrapper instead.

Check-Specific Parameters

Use the following parameters to configure this check:

:replacement

Your env wrapper module name, shown in the message.

This parameter defaults to "Ambient.Env".

:exempt_suffixes

File path suffixes exempt from the check (your wrapper's own file, and usually config/runtime.exs).

This parameter defaults to ["lib/ambient/env.ex"].

General Parameters

Like with all checks, general params can be applied.

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