Mailglass.Credo.NoDirectDateTimeNow (Mailglass v1.0.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

DateTime.utc_now/0 calls must be routed through Mailglass.Clock so time-dependent code remains deterministic under test.

Check-Specific Parameters

Use the following parameters to configure this check:

:allowed_modules

Modules allowed to call DateTime.utc_now/0 directly.

This parameter defaults to [Mailglass.Clock, Mailglass.Clock.System].

:included_path_prefixes

Only files in these path prefixes are linted.

This parameter defaults to ["lib/mailglass/"].

General Parameters

Like with all checks, general params can be applied.

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