ExSlop.Check.Readability.BoilerplateDocParams (ExSlop v0.3.1)

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 low and works with any version of Elixir.

Explanation

@doc strings with a ## Parameters section that merely restates the function signature add no value.

# bad
@doc """
Renders the index page.

## Parameters

- conn: The connection struct
- params: A map of parameters
"""
def index(conn, params)

# good — document constraints, not names
@doc """
Renders the index page.

## Parameters

- params: Must include `"page"` (integer >= 1) and
  optionally `"per_page"` (default 20, max 100).
"""

# good — no ## Parameters section at all
@doc """
Renders the index page, paginated.
"""

Check-Specific Parameters

There are no specific parameters for this check.

General Parameters

Like with all checks, general params can be applied.

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