# `GitHoox.Reporter`
[🔗](https://github.com/sgerrand/git_hoox/blob/v0.5.0/lib/git_hoox/reporter.ex#L1)

Reference `:telemetry` handler that prints coloured hook status to the
terminal.

Sibling of `GitHoox.Logger`: same events, but writes plain `IO` lines
(no log levels, no timestamps, no `Logger` config) so the output reads
as a status report rather than a log. Attach it before running hooks:

    GitHoox.Reporter.attach()

`mix git_hoox.run` attaches it by default; set `config :git_hoox,
reporter: false` to opt out. Detach with `GitHoox.Reporter.detach/0`.

Output looks like:

    → pre-commit · 3 hooks · 5 files
      ▸ Format
      ✓ Format · 38ms
      ▸ Credo
      ✗ Credo · exit 1 · 1.4s
      - Test · skipped (no matched files)
    ✗ pre-commit · 1/3 failed · 1.5s

Stages with no configured hooks print nothing (every commit fires
several shims; without this they would all emit noise).

## Colour

Colour is decided once at `attach/0` and fixed for the handler's life.
Precedence, first match wins:

  1. `GIT_HOOX_COLOR=always` → on, `=never` → off.
  2. `NO_COLOR` set (any value) → off.
  3. `CLICOLOR_FORCE` / `FORCE_COLOR` set and not `"0"` → on.
  4. `IO.ANSI.enabled?/0` — true on a TTY, false through a pipe.

Pass `attach(color: true)` / `attach(color: false)` to override the
detection (used by tests).

# `attach`

```elixir
@spec attach(keyword()) :: :ok | {:error, :already_exists}
```

Attach the handler.

Options:

  * `:color` — force colour on/off, skipping environment detection.

# `detach`

```elixir
@spec detach() :: :ok | {:error, :not_found}
```

Detach the handler. Safe to call when not attached.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
