Skip to content

About

Docs that lie are bugs. DriftWatch statically checks markdown claims — paths, commands, env vars, links — against repository reality.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DriftWatch

Docs that lie are bugs. DriftWatch checks markdown claims against repository reality.

Why

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.

What it checks

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.

Quickstart

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

Exit codes

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.

Adopting on an existing repo

  1. Run driftwatch scan . and fix or silence what is wrong.
  2. Run driftwatch scan . --write-baseline to record the remaining backlog.
  3. Commit the baseline, then tighten: fix baselined findings over time and regenerate it.

Details are in the user guide.

CI

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.

Documentation

License

DriftWatch is licensed under the PolyForm Noncommercial License 1.0.0. For commercial use, see COMMERCIAL-LICENSE.md. For contributions, see CONTRIBUTING.md.

About

Docs that lie are bugs. DriftWatch statically checks markdown claims — paths, commands, env vars, links — against repository reality.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages