# `LexCredo.Check.Readability.DocExamplesSection`
[🔗](https://github.com/sippy-platform/lex_credo/blob/main/lib/lex_credo/check/readability/doc_examples_section.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

Every `@doc` string on a public function should include a `## Examples` section.

Examples are the fastest way for a reader to understand what a function does.
Use `iex>` doctests for deterministic output; use a plain code block when the
result depends on runtime state.

    # BAD — no Examples section
    @doc """
    Adds two numbers.
    """
    def add(a, b), do: a + b

    # GOOD
    @doc """
    Adds two numbers.

    ## Examples

        iex> MyModule.add(1, 2)
        3

    """
    def add(a, b), do: a + b

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:exclude_test_files`

  When `true`, skips test files. Default: `false`.

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