VulnCheck.Workspace.Detector (VulnCheck v1.0.1)

Copy Markdown View Source

Detects the kind of BEAM project located in a directory.

  • :umbrella — mix.exs declaring apps_path (or an apps/*/mix.exs layout) with a root mix.lock
  • :mix — mix.exs with mix.lock
  • :gleam — gleam.toml with manifest.toml
  • :rebar3 — rebar.config with rebar.lock

Summary

Functions

Detects the project type of dir.

Types

info()

@type info() :: %{
  type: :mix | :umbrella | :rebar3 | :gleam,
  root: String.t(),
  lockfile: String.t(),
  manifest: String.t()
}

Functions

detect(dir)

@spec detect(Path.t()) ::
  {:ok, info()} | {:error, :lockfile_not_found | :unknown_project, String.t()}

Detects the project type of dir.

Returns {:error, :lockfile_not_found, details} when a project manifest is present without its lockfile, and {:error, :unknown_project, details} when no supported manifest exists.