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

Parser for rebar3 `rebar.lock` files (both the legacy bare list format and
the versioned `{"1.2.0", [...]}.` format with `pkg_hash` / `pkg_hash_ext`
checksum sections).

rebar3 only locks the default profile, so every locked package belongs to
the production closure.

# `parse`

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

Parses `rebar.lock` content into `name => Package`.

# `parse_file`

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

Reads and parses a `rebar.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 a `rebar.lock` file, 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`, also returning warnings for unsupported lock entries.

---

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