Skip to content

enhancement: add --baseline flag to compare findings against a saved snapshot #2

@depmedicdev-byte

Description

@depmedicdev-byte

What

Add ci-doctor --baseline=baseline.json so a CI run only fails on
findings that are new relative to a checked-in snapshot. This makes
adoption viable on legacy repos that have hundreds of pre-existing
warnings.

Why

Every linter that landed in a real org needed this. Without it, the
first run is noise; with it, teams can ratchet the bar over time.

Sketch

  1. ci-doctor --json --baseline-out baseline.json writes the current
    set of {ruleId, file, line} tuples to disk.
  2. ci-doctor --baseline baseline.json filters out any finding whose
    tuple is in the baseline before printing.
  3. --baseline should ignore line drift (match on
    {ruleId, file, normalized-message} to allow line shifts).

Acceptance

  • Two new flags work end-to-end
  • Test in test/baseline.test.js covering: baseline empty, baseline
    exact, baseline with line drift, baseline with new finding
  • README "Adopting on a legacy repo" section added

Estimate

~3-4 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions