KogenCredo.Check.Warning.StringKeyAccess (KogenCredo v0.1.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

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

Explanation

Decode external JSON/YAML/params once, in a codec module, into a struct, and use struct fields inside the core. String-keyed maps spread the wire shape through the code base and turn typos into silent nils.

Check-Specific Parameters

Use the following parameters to configure this check:

:included_paths

Only files under these path prefixes are checked.

This parameter defaults to ["lib/"].

:excluded_paths

Files under these path prefixes are skipped.

This parameter defaults to [].

:codec_modules

Modules (and nested modules) allowed to use string keys.

This parameter defaults to [].

:codec_globs

Filename globs allowed to use string keys.

This parameter defaults to [].

General Parameters

Like with all checks, general params can be applied.

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