# `ZebbraCredo.Check.NoAnonymousDslFunctions`
[🔗](https://github.com/zebbra/zebbra_credo/blob/v1.0.0/lib/zebbra_credo/check/no_anonymous_dsl_functions.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

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

## Explanation

`change fn ... end`, `run &Mod.fun/2`, `prepare fn ...` and
`validate fn ...` hide logic in anonymous functions that cannot be named,
reused, tested or found. Put each in its own module and reference it:
`change MyApp.Orders.Changes.Slugify` or `change {Module, opts}`.

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:files`

  Files to check (Credo's `included`/`excluded` globs); defaults to `lib/`.

*This parameter defaults to* `%{included: ["lib/"]}`.

### `:macros`

  The DSL macros whose first argument must not be an anonymous function.

*This parameter defaults to* `[:run, :change, :prepare, :validate]`.

### `:allowed`

  File globs that may use anonymous functions in these macros.

*This parameter defaults to* `[]`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
