Baseline Mode
What is Baseline Mode?
Section titled “What is Baseline Mode?”When adding validation to an existing project, you may have many code blocks that already fail. Baseline mode lets you record these known errors so that only new errors cause CI failures.
Generate a Baseline
Section titled “Generate a Baseline”Run the validator with --save-baseline to create a baseline file from the current state:
md-go-validator --save-baseline baseline.txt .The baseline file contains signatures in the format file:line:errorcode. Each signature uniquely identifies a known error.
Use the Baseline
Section titled “Use the Baseline”In CI, pass --baseline to filter out known errors:
md-go-validator --baseline baseline.txt .Only errors that are not in the baseline will cause a non-zero exit code.
Workflow
Section titled “Workflow”- Initial adoption: Run
--save-baselineto capture existing errors - Commit the baseline:
git add baseline.txt - Fix incrementally: As you fix errors, regenerate the baseline
- Enforce going forward: CI fails only on new errors
Updating the Baseline
Section titled “Updating the Baseline”After fixing errors, regenerate:
md-go-validator --save-baseline baseline.txt .git add baseline.txtgit commit -m "chore: update baseline after fixing doc errors"See Also
Section titled “See Also”- CI Integration for pipeline setup
- CLI Options for all flags