# `ExQuality.Tools`
[🔗](https://github.com/riddler/ex_quality/blob/v0.15.0/lib/ex_quality/tools.ex#L1)

Detects which quality tools are available in the project.

Checks the project's declared dependencies for tool packages and determines
which stages should be enabled by default.

In an umbrella, the root `mix.exs` usually declares no dependencies, so the
root's deps are unioned with every child app's (`ExQuality.Umbrella`).
Reading only the root would report every tool as missing and quietly run a
fraction of the checks.

## Example

    ExQuality.Tools.detect()
    #=> %{
      credo: true,
      dialyzer: true,
      doctor: false,
      docs: true,
      coverage: true,
      native_coverage: false,
      gettext: false,
      audit: true,
      sobelow: false
    }

    ExQuality.Tools.available?(:credo)
    #=> true

`:native_coverage` is the exception: it is not a package but the absence of
one. Elixir has shipped `mix test --cover` since 1.11, so a project without
`:excoveralls` still has a coverage tool, and the stage needs to know which of
the two it is talking to.

# `available?`

```elixir
@spec available?(atom()) :: boolean()
```

Checks if a specific tool is available.

Returns false if the tool is not recognized or not installed.

# `detect`

```elixir
@spec detect() :: %{required(atom()) =&gt; boolean()}
```

Returns a map of tool availability.

Scans the project's dependencies to determine which quality
checking tools are installed.

# `package`

```elixir
@spec package(atom()) :: atom() | nil
```

Returns the package a tool is detected from, or `nil` for an unknown tool.

## Examples

    ExQuality.Tools.package(:dialyzer)
    #=> :dialyxir

---

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