# `Bylaw.Credo.Check.Elixir.NamedSpecParams`
[🔗](https://github.com/ryanzidago/bylaw/blob/v0.1.0-alpha.1/lib/bylaw/credo/check/elixir/named_spec_params.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 `normal` and works with any version of Elixir.

## Explanation

Requires named parameters in all `@spec` declarations.

## Examples

Avoid:
Positional-only types omit what each argument represents:

      @spec fetch(UUIDv7.t(), integer()) :: {:ok, Run.t()} | {:error, term()}
      @spec submit(UUIDv7.t(), UUIDv7.t(), UUIDv7.t(), UUIDv7.t(), list(map())) :: :ok
Prefer:
Give each parameter a name so the spec is self-documenting:

      @spec fetch(run_id :: UUIDv7.t(), limit :: integer()) :: {:ok, Run.t()} | {:error, term()}
      @spec submit(
              tenant_id :: UUIDv7.t(),
              workspace_id :: UUIDv7.t(),
              run_id :: UUIDv7.t(),
              message_id :: UUIDv7.t(),
              tool_results :: list(map())
            ) :: :ok

## 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.NamedSpecParams,
         [
           min_params: 2
         ]}
      ]
    }
  ]
}
```

- `:min_params` - Minimum number of parameters to trigger the check (default: 1).

## Usage

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

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

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:min_params`

  Minimum number of parameters to trigger the check (default: 1).

*This parameter defaults to* `1`.

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