Docs that lie are bugs. DriftWatch checks markdown claims against repository reality.
Documentation that lies is a bug. A wrong install command or a documented-but-dead environment variable costs every newcomer an afternoon. In AI-assisted development it is worse: agents read the docs and turn documentation lies into code bugs.
| Checker | Claim | Example finding |
|---|---|---|
| paths | A file or directory named in the docs exists. | A documented script that was deleted. |
| links + anchors | Internal links resolve to a file and a heading. | A link to a heading that was renamed. |
| commands | Shell commands in fences refer to real entry points. | A documented command that no longer exists. |
| env | Documented and code-read environment variables agree, in both directions. | A documented variable that no code reads. |
All four checkers run in a normal scan; see the checker reference for details.
Install from the repository:
git clone https://github.com/malinele/driftwatch.git
cd driftwatch
pip install -e .
driftwatch scan .Sample output:
README.md:1: WARNING [env] env var read by code but undocumented: DEMO_FLAG
README.md:3: ERROR [path] path does not exist: scripts/old_run.sh
README.md:5: ERROR [link] link target does not exist: docs/missing.md
README.md:6: ERROR [anchor] anchor does not match any heading: docs/setup.md#nope (available: #setup, #installation)
README.md:10: ERROR [command] documented command not found: ./scripts/deploy.sh
docs/setup.md:5: ERROR [path] path does not exist: config/settings.yaml
docs/setup.md:9: ERROR [env] documented env var is not read by the code: APP_SECRET_KEY
6 error(s), 1 warning(s) in 2 file(s) scanned
| Code | Meaning |
|---|---|
| 0 | No remaining finding at or above the failure severity (default: error). |
| 1 | At least one remaining finding is at or above it. |
| 2 | Usage or setup problem: bad path, invalid configuration, unreadable baseline. |
- Run
driftwatch scan .and fix or silence what is wrong. - Run
driftwatch scan . --write-baselineto record the remaining backlog. - Commit the baseline, then tighten: fix baselined findings over time and regenerate it.
Details are in the user guide.
Run driftwatch scan . in your pipeline; a non-zero exit fails the build.
Use --format sarif with --output to publish findings to code scanning. See CI integration.
- User guide
- Checker reference
- CI integration
- Changelog
- Benchmark evidence: the verifiable benchmark evidence (pinned commits, raw outputs, per-finding verdicts)
DriftWatch is licensed under the PolyForm Noncommercial License 1.0.0. For commercial use, see COMMERCIAL-LICENSE.md. For contributions, see CONTRIBUTING.md.