Your README code examples are silently lying — I built a CLI to detect documentation drift using only AST, no LLM
Your README code examples are silently lying — I built a CLI to detect documentation drift using only AST, no LLM "Did you know? This README example doesn't work." Have you ever had a junior engineer tell you that? Or worse — have you added a line to your code, forgot the docs, and broke it yourself ? This time I want to tell you about doc-drift , a CLI I built that detects this "documentation…
Your README code examples aren't always accurate, and I've built a command-line tool to detect documentation drift using only Abstract Syntax Trees (AST), without relying on Large Language Models (LLMs). This tool, named doc-drift, is available at https://github.com/sunnydachs/doc-drift.
Doc-drift scans your repository for Markdown files with fenced code blocks, extracts the defined functions and classes, and compares them to the actual codebase. It reports three main findings: SIGNATURE DRIFT (the documented function exists, but its arguments have changed), MISSING (the documented function/class no longer exists in the repository), and UNPARSEABLE (the block isn't valid Python code). The tool is designed to be deterministic, safe, and read-only, with no dependencies beyond Python 3.11+.
The author emphasizes that the tool is meant to catch issues that other tools, like IDEs and static analysis, cannot. This includes scenarios where code examples in docs are simplified versions of the actual codebase. The tool is currently limited to Python, but the author plans to expand support for other languages in the future.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.