Usage¶
Scan¶
Scan a repository for drift:
Scan a specific directory:
Auto-Fix¶
Rewrites documentation files to match toolchain versions:
This modifies the doc files (README.md, CONTRIBUTING.md, etc.) to match the toolchain file values. Lines not mentioning the drifted version are left intact.
List Detectors¶
See all 66 registered detectors:
Filter Detectors¶
Run specific detectors:
Exclude specific detectors:
Short names also work:
Informational Drifts¶
Some detectors (lockfile presence, CI OS, nvmrc mismatch) are informational by default. To treat them as blocking:
To skip them entirely:
Quiet Mode¶
Only output drift findings (suppress "OK" messages):
Markdown Report¶
Generate a markdown summary for CI job summaries or PR comments:
SARIF Output¶
Generate SARIF 2.1.0 for GitHub Code Scanning:
Then upload with github/codeql-action/upload-sarif:
- uses: yunaremaia/driftcheck@main
with:
sarif: true
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: driftcheck.sarif
Initialize Config¶
Generate a starter .driftcheck.toml:
Creates a .driftcheck.toml with example configuration options.
Exit Codes¶
| Code | Meaning |
|---|---|
| 0 | No drift detected |
| 1 | Drift detected (use in CI) |
| 2 | Error (invalid arguments, missing repo, etc.) |
Exit Codes (Custom)¶
Make driftcheck always exit 0 (useful for check-only runs):