# `ExQuality.Init.VersionResolver`
[🔗](https://github.com/riddler/ex_quality/blob/v0.16.0/lib/ex_quality/init/version_resolver.ex#L1)

Resolves latest package versions from hex.pm.

Uses `mix hex.info <package>` to fetch version information and parses
the recommended version string from the output.

# `fetch_versions`

```elixir
@spec fetch_versions([atom()]) :: %{required(atom()) =&gt; {atom(), String.t()}}
```

Fetches latest versions for the given tools.

Returns a map of tool -> {package_name, version_spec}.

## Examples

    fetch_versions([:credo, :dialyzer])
    #=> %{
      credo: {:credo, "~> 1.7"},
      dialyzer: {:dialyxir, "~> 1.4"}
    }

# `parse_version_from_output`

```elixir
@spec parse_version_from_output(String.t()) :: String.t()
```

Parses version from hex.info output.

Looks for the Config line which contains the recommended version string.

## Examples

    output = """
    Config: {:credo, "~> 1.7"}
    Locked version: 1.7.15
    Releases: 1.7.15, 1.7.14, ...
    """

    parse_version_from_output(output)
    #=> "~> 1.7"

Falls back to parsing the Releases line if Config is not found,
and uses "~> 0.1" as a last resort.

---

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