# `VulnCheck.Config`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/config.ex#L1)

Scan configuration resolved from command-line flags, `.vulncheck.exs` and
built-in defaults (in that order of precedence).

`.vulncheck.exs` is a declarative keyword list. It is parsed with
`VulnCheck.Literal`, which never evaluates code and never creates atoms:
only literals, whitelisted option values and module aliases are accepted.

    [
      env: :prod,
      fail_on: :potentially_reachable,
      min_severity: :low,
      fail_on_retired: true,
      configured_adapters: [tesla: Tesla.Adapter.Mint],
      extra_entrypoints: [{MyApp.ReleaseTasks, :migrate, 0}],
      ignore_file: ".vulncheck.ignore",
      require_ignore_reason: true,
      require_ignore_expiry: true,
      cache_dir: nil,
      cache_ttl_seconds: 3600
    ]

# `fail_on`

```elixir
@type fail_on() :: :reachable | :potentially_reachable | :any | :none
```

# `format`

```elixir
@type format() ::
  :terminal
  | :json
  | :markdown
  | :sarif
  | :github
  | :gitlab
  | :cyclonedx
  | :openvex
```

# `min_severity`

```elixir
@type min_severity() :: :low | :medium | :high | :critical
```

# `t`

```elixir
@type t() :: %VulnCheck.Config{
  args: [String.t()],
  baseline: String.t() | nil,
  beam_timeout: pos_integer(),
  bundle: String.t() | nil,
  cache_dir: String.t() | nil,
  cache_ttl_seconds: non_neg_integer(),
  check_retired: boolean(),
  color: boolean(),
  config_file: String.t() | nil,
  configured_adapters: %{required(atom()) =&gt; [String.t()]},
  diff: String.t() | nil,
  env: :prod | :dev | :test,
  extra_entrypoints: [VulnCheck.Types.MFA.t()],
  fail_on: fail_on(),
  fail_on_retired: boolean(),
  feed_selection: map() | nil,
  feed_snapshot: String.t() | nil,
  forbid_new_suppressions: boolean(),
  force: boolean(),
  format: format(),
  ignore_file: String.t(),
  max_beam_bytes: pos_integer(),
  max_beam_files: pos_integer(),
  max_beam_heap_bytes: pos_integer(),
  max_feed_age_seconds: non_neg_integer() | nil,
  min_severity: min_severity(),
  offline: boolean(),
  otp_version: String.t() | nil,
  output: String.t() | nil,
  project_dir: String.t(),
  quiet: boolean(),
  require_ignore_expiry: boolean(),
  require_ignore_reason: boolean(),
  sarif: String.t() | nil,
  sbom: String.t() | nil,
  show_unreachable: boolean(),
  vex: String.t() | nil,
  write_baseline: String.t() | nil
}
```

# `adapter_families`

```elixir
@spec adapter_families() :: [atom()]
```

Supported adapter families for `configured_adapters`.

# `aliases`

```elixir
@spec aliases() :: keyword()
```

The OptionParser aliases understood by every scanning command.

# `fail_on_values`

```elixir
@spec fail_on_values() :: [fail_on()]
```

Supported `--fail-on` tiers.

# `formats`

```elixir
@spec formats() :: [format()]
```

Supported output formats.

# `from_cli_and_file`

```elixir
@spec from_cli_and_file([String.t()], keyword()) :: {:ok, t()} | {:error, String.t()}
```

Builds a configuration from CLI arguments and the project's `.vulncheck.exs`.

Precedence: CLI flags > `.vulncheck.exs` > defaults.

Options:

  * `:cwd` — directory used to resolve a relative `--project-dir` (default: `File.cwd!/0`)
  * `:extra_switches` — additional OptionParser switches accepted by a subcommand
  * `:allow_args` — when `true`, positional arguments are kept in `config.args`
    instead of being rejected

# `ignore_path`

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

Absolute path of the ignore file.

# `load_file`

```elixir
@spec load_file(t()) :: {:ok, t()} | {:error, String.t()}
```

Loads a `.vulncheck.exs` file (or any declarative config file) and merges it
into the given configuration.

# `parse_config_file`

```elixir
@spec parse_config_file(Path.t()) ::
  {:ok, VulnCheck.Literal.lterm()} | {:error, String.t()}
```

Parses a declarative configuration file without evaluating it.

# `project_root`

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

Absolute path of the scanned project.

# `severity_rank`

```elixir
@spec severity_rank(atom()) :: non_neg_integer()
```

Returns the severity rank used for threshold comparisons (`critical` = 4).
Unknown severities rank as `:critical` (fail-safe).

# `switches`

```elixir
@spec switches() :: keyword()
```

The OptionParser switches understood by every scanning command.

---

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