Skip to main content

:::tip Looking for the recipe? See Workflows → Adopt on a legacy codebase for the task-driven guide. This page is the reference. :::

zuit baseline

zuit baseline save [OPTIONS] [PATH]

Captures the current findings as a zuit-baseline.json file. Use the baseline file with zuit analyze --baseline to suppress pre-existing issues, so only new findings trigger --fail-on.

Subcommands​

SubcommandEffect
baseline saveRun analysis and write findings to a JSON file.

Flags​

FlagTypeDefaultDescription
--ref <GIT_REF>stringunset (working tree)Capture findings from a git ref (tag, branch, or commit SHA). Uses `git archive
-o <FILE>pathzuit-baseline.jsonWrite the baseline to this file instead of the default.
--config <FILE>pathautoPath to a zuit.toml. Overrides the default upward search.
[PATH]path.Root path to analyse.

Examples​

Capture the baseline from the working tree:

zuit baseline save

Capture the baseline from a released tag:

zuit baseline save --ref v1.0.0 -o baseline-v1.0.0.json

Apply the baseline to suppress pre-existing issues in CI:

zuit analyze . --baseline zuit-baseline.json --fail-on high

Workflow​

  1. Capture a baseline on the current state of the codebase:

    zuit baseline save -o zuit-baseline.json
    git add zuit-baseline.json
    git commit -m "chore: zuit baseline"
  2. In CI and local runs, apply the baseline:

    zuit analyze . --baseline zuit-baseline.json --fail-on medium
  3. Refresh the baseline periodically as legacy findings are fixed:

    zuit baseline save -o zuit-baseline.json

See also​