# `Bylaw.Credo.Check.Elixir.NoPassthroughWrapper`
[🔗](https://github.com/ryanzidago/bylaw/blob/v0.1.0-alpha.1/lib/bylaw/credo/check/elixir/no_passthrough_wrapper.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

Avoid private functions that only forward their arguments to a single call.
Inline the call instead.

## Examples

Avoid:

      defp format_datetime(datetime), do: DateTime.to_iso8601(datetime)
Prefer:

      DateTime.to_iso8601(datetime)

If the wrapper name materially improves readability, keep it and disable
this check locally:

      # credo:disable-for-next-line Bylaw.Credo.Check.Elixir.NoPassthroughWrapper
      defp format_datetime(datetime), do: DateTime.to_iso8601(datetime)

## Notes

This check uses static AST analysis, so it favors clear source-level patterns over runtime behavior.

## Options

Configure options in `.credo.exs` with the check tuple:

```elixir
%{
  configs: [
    %{
      name: "default",
      checks: [
        {Bylaw.Credo.Check.Elixir.NoPassthroughWrapper,
         [
           include_public: true
         ]}
      ]
    }
  ]
}
```

- `:include_public` - When true, also report public `def` passthrough wrappers

## Usage

Add this check to Credo's `checks:` list in `.credo.exs`:

```elixir
%{
  configs: [
    %{
      name: "default",
      checks: [
        {Bylaw.Credo.Check.Elixir.NoPassthroughWrapper, []}
      ]
    }
  ]
}
```

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:include_public`

  When true, also report public `def` passthrough wrappers

*This parameter defaults to* `false`.

## 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*
