October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Catch README Code Drift with a Static Python Checker

doc-drift is described as a static Python checker for finding missing names and signature changes in Markdown examples. Learn what it catches, what it cannot verify, and how to assess its fit.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

doc-drift is a command-line checker described by its builder as a way to find Python functions and classes in Markdown code examples that no longer match a repository. It compares syntax rather than importing or running the project, so it can flag missing names and signature changes without executing inspected code. It is most useful when documentation snippets are intended to reflect real Python code—not when they are illustrative pseudocode.

What doc-drift checks in README files

In a September 16, 2026 DEV Community article, author and builder sunnydachs describes doc-drift as scanning repository Markdown files for fenced code blocks, then comparing Python functions and classes in those blocks with the repository’s code. The tool reports three kinds of findings:

As an Amazon Associate I earn from qualifying purchases.

  • SIGNATURE DRIFT: A documented function is present in the code, but its argument names differ.
  • MISSING: A documented function or class cannot be found in the repository.
  • UNPARSEABLE: A block is not valid Python, such as pseudocode or a placeholder. The author characterizes this as informational.

These checks address a specific form of documentation drift: code examples that name constructs that have been removed or whose signatures have changed. They do not establish that an example is correct in meaning or that it runs successfully.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How its AST-based approach works

According to sunnydachs, doc-drift uses Python’s standard ast module to compare syntax. The author says, “It never imports or executes your code — it compares at the syntax-tree level.” (DEV Community article, September 16, 2026.) The article states Python 3.11 or newer is required.

That static approach avoids running repository code during inspection, but it also defines what the checker can see. The stated matching rule permits examples to simplify real code by omitting arguments or class methods; it should not invent functions or methods that the implementation lacks. In the author’s formulation: “Omit arguments — allowed. Invent arguments or functions that don’t exist in the code — forbidden.” This is doc-drift’s design rule, not a general standard for all documentation checks.

How to run it and read the output

The article shows these invocations:

doc-drift
doc-drift /path/to/repo --json

The first command is shown for scanning a repository; the second supplies a repository path and requests machine-readable JSON output. The article does not establish current installation instructions or provide a confirmed release, so these examples should not be taken as a complete setup guide.

Its sample output includes Markdown-file and code-block counts, a signature mismatch, and a JSON summary. Those are illustrative values, not expected results or a performance benchmark. JSON may be useful when building an automated workflow, but the article does not document a maintained GitHub Action or a specific CI integration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Where it can help—and where it can mislead

Best fit: executable examples that should track the code

doc-drift is aimed at documentation trees where Python snippets are meant to mirror repository functions and classes. In that setting, a missing name or changed argument list can be a useful prompt to update the example or reconsider the implementation.

Illustrations can produce false positives

The checker cannot determine whether a snippet is intended as executable documentation or simply illustrates an idea. A README example that deliberately uses a made-up function may therefore be reported as missing. Treat such findings as review items, not automatic proof that the documentation is wrong.

Python-only and name-based

The article says other-language code blocks may be counted but are not checked. It also says default values and type annotations are ignored. The comparison targets names, removals, and argument-name or arity differences; it does not validate behavior, semantic correctness, or whether the documented call works in context.

What the author’s scan does—and does not—show

sunnydachs reports scanning 1,692 Markdown files and 4,451 code blocks in a repository, finding one genuine drift: documentation showed a function with two arguments while the implementation had moved to one. The author also says an overly broad default exclusion caused false positives and was corrected. These counts and outcomes are the author’s account; the repository identity, methodology, and results were not independently verified in the article. They are evidence of one reported run, not a measure of how common README drift is across software projects.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to decide whether a checker fits your documentation

Before adopting any documentation checker, assess it against the way your examples are written:

  • Language coverage: Does it inspect the languages used in your docs, or only Python?
  • Execution model: Does it execute examples, analyze syntax statically, or combine approaches? Consider the safety and coverage trade-offs.
  • Depth: Does it check names and signatures, or also verify behavior and meaning?
  • Illustrations: Can you distinguish runnable examples from pseudocode, or will you need to review false positives?
  • Automation: Is the report format usable in your workflow, and is a supported CI integration actually documented?
  • Maintenance: Are installation steps, releases, and project status verifiable for the version you plan to use?

The linked article presents doc-drift’s design and examples, but does not independently establish its current release status, license, installation process, or a maintained CI integration. Verify those details in the project repository before relying on it in a team workflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.