# `VulnCheck.Workspace.MixLock`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/workspace/mix_lock.ex#L1)

Atom-safe parser for `mix.lock`.

The lockfile is read with `VulnCheck.Literal` (never evaluated) and every
supported entry format is normalized into a `VulnCheck.Types.Package`:

  * Hex 8-tuples: `{:hex, :pkg, "1.2.3", inner, managers, deps, "hexpm", outer}`
  * legacy Hex 7-, 6-, 5- and 4-tuples
  * Git dependencies: `{:git, url, sha, opts}`

Optional sub-dependencies are only linked when the optional package itself
is present in the lockfile, matching how Mix resolves them.

# `parse`

```elixir
@spec parse(String.t(), keyword()) ::
  {:ok, %{required(String.t()) =&gt; VulnCheck.Types.Package.t()}}
  | {:error, String.t()}
```

Parses `mix.lock` content into a map of `app_name => Package` (scope `:prod`
until the workspace loader computes the real closure).

# `parse_file`

```elixir
@spec parse_file(Path.t()) ::
  {:ok, %{required(String.t()) =&gt; VulnCheck.Types.Package.t()}}
  | {:error, String.t()}
```

Reads and parses a `mix.lock` file.

# `parse_file_with_warnings`

```elixir
@spec parse_file_with_warnings(Path.t()) ::
  {:ok, %{required(String.t()) =&gt; VulnCheck.Types.Package.t()}, [String.t()]}
  | {:error, String.t()}
```

Reads and parses `mix.lock`, also returning unsupported-entry warnings.

# `parse_with_warnings`

```elixir
@spec parse_with_warnings(String.t(), keyword()) ::
  {:ok, %{required(String.t()) =&gt; VulnCheck.Types.Package.t()}, [String.t()]}
  | {:error, String.t()}
```

Like `parse/2`, returning `{:ok, packages, warnings}` where `warnings` lists
any unsupported lockfile entries.

---

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