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

## Explanation

Avoid `~T[23:59:59]` as an end-of-day bound.

## Examples

Avoid:

      occurred_at >= day_start and occurred_at <= ~T[23:59:59]

Prefer:

      occurred_at >= day_start and occurred_at < next_day_start

## Notes

An inclusive `23:59:59` bound misses values with fractional seconds, such
as `23:59:59.500000`. That creates edge-case bugs for timestamp and time
comparisons.

Use the next day's midnight as an exclusive upper bound. Half-open ranges
include every representable time in the day without guessing precision.

Path exclusions are matched against the source filename and are intended for generated files or temporary migration areas.

The check uses static AST analysis, so dynamic code generation and macro-expanded code may fall outside its signal.

## Options

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

```elixir
%{
  configs: [
    %{
      name: "default",
      checks: [
        {Bylaw.Credo.Check.Elixir.NoEndOfDayTime,
         [
           excluded_paths: ["test/support/"]
         ]}
      ]
    }
  ]
}
```

- `:excluded_paths` - Paths containing any configured string are skipped. Defaults to `test/` so fixtures and assertions can still describe boundary values directly.

## Usage

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

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

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:excluded_paths`

  Paths containing any configured string are skipped. Defaults to `test/`
  so fixtures and assertions can still describe boundary values directly.
  

*This parameter defaults to* `["test/"]`.

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