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

Governed suppressions from `.vulncheck.ignore`.

The file holds a list of maps (or keyword lists) and is parsed as data,
never evaluated:

    [
      %{
        id: "CVE-2026-54892",
        package: "plug",
        reason: "WAF blocks nested query depth > 4; upgrade scheduled",
        expires: "2027-01-31"
      }
    ]

A rule matches a finding by advisory id or any alias, optionally limited
to one package. Rules without a reason (when `require_ignore_reason`) or
without a valid expiry (when `require_ignore_expiry`) are rejected with a
warning. Expired rules do not suppress: the finding is flagged with
`suppression_expired` and the scan reports a policy violation.

# `apply_rules`

```elixir
@spec apply_rules(
  [VulnCheck.Types.Finding.t()],
  [VulnCheck.Ignore.Rule.t()],
  Date.t()
) ::
  {[VulnCheck.Types.Finding.t()], [String.t()], [String.t()]}
```

Applies rules to findings as of `today`. Returns the updated findings,
policy violations (expired suppressions) and warnings (unused rules).

# `load`

```elixir
@spec load(VulnCheck.Config.t()) ::
  {:ok, [VulnCheck.Ignore.Rule.t()], [String.t()]} | {:error, String.t()}
```

Loads the configured ignore file. A missing file yields no rules.

# `new_suppressions`

```elixir
@spec new_suppressions(VulnCheck.Config.t(), [VulnCheck.Ignore.Rule.t()]) :: [
  String.t()
]
```

Compares the current rules with the ignore file at the base revision
(`config.diff`, else `origin/main` or `HEAD~1`). New entries and
extended expiry dates are violations; so is an unverifiable base.

# `parse`

```elixir
@spec parse(String.t(), VulnCheck.Config.t(), keyword()) ::
  {:ok, [VulnCheck.Ignore.Rule.t()], [String.t()]} | {:error, String.t()}
```

Parses ignore file contents. Returns the valid rules and warnings for
rejected entries.

# `step`

```elixir
@spec step(keyword()) :: (list(), map() -&gt; {list(), [String.t()], [String.t()]})
```

Post-processing step for `VulnCheck.Scanner`: loads the ignore file,
applies it and, with `forbid_new_suppressions`, checks it against the
base revision.

---

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