Delphi-RAG-Lint

drag-lint help

doc-drift

Since: 0.93.0-alpha

Diagnostic that computes deterministic doc-vs-code drift findings for one symbol.

Read this when you want to know why an existing doc comment is considered out of date. doc-drift prints the deterministic doc-versus-code drift findings for one symbol.

How to run it

Full flag list: doc-drift in the CLI reference.

Flags

FlagArgumentMeaningDefault
--qnameX
--dbPATH
--json

Where to click

No IDE surface: this feature runs from the CLI (see How to run it).

Needs: index

Details

Diagnostic that computes deterministic doc-vs-code drift findings for one symbol. Reach for it to see exactly why document/autodoc considers a symbol's existing doc comment out of date.

Running it from the CLI

drag-lint doc-drift --qname X --db PATH [--json]

--qname X is the symbol to check. --json emits machine-readable output.

This is labeled a "diagnostic" in the CLI banner -- it is a troubleshooting tool, not a daily driver.

Exceptions raised in callees

An <exception cref="EFoo"> is not drift when the routine, or a callee up to three calls down (resolved call edges only), raises EFoo. The walk is breadth-first and cycle-safe, capped at 256 visited symbols (CREF_RAISE_MAX_HOPS = 3, CREF_RAISE_MAX_VISITS = 256 in src\doc\DRagLint.Doc.Drift.pas) so a hub routine cannot walk the whole call graph. A raise beyond three hops, or past the cap, is still reported. It used to be one hop.

A call into the RTL has no call edge, so the same question goes to the platform library index (--library-db, else the manifest's): Ini.WriteString satisfies <exception cref="EIniFileException"> because TIniFile.WriteString's body raises it. An abstract method counts its overrides, and so does a virtual one that is not final (each override is a dispatch target); a static member of the same name in a descendant hides the base and is not read. A bare call (LibRaiser(x)) is answered only by a free routine of a unit the calling file uses (or System / SysInit). Only a raise actually found there silences the finding: with no library, or a callee the library does not hold, it stands. A class the project itself declares is never asked about.

Used in units: holds units only

A class name found in a stored Used in units: list (one this index resolves as a class, interface or record and not as a unit) is drift: the fix moves it to its own <para>Used in classes: ...</para> line, written directly after Used in units:. The engine never renders that line itself; it keeps it on every regeneration, and doc-drift never calls it out of date. A name the index cannot see stays in Used in units:. (Backlog X-24, owner ruling 2026-10-25.)

What it needs

An index IS required. The project's DB lives at <project folder>\_D-RAG\<project file>.sqlite; run drag-lint resolve-dbs --project <X.dproj> if unsure.

Example

Illustrative only:

drag-lint doc-drift --qname CustomerOrder.TCustomerOrder.Total --db C:\Projects\MyApp\_D-RAG\MyApp.sqlite --json

This would report the specific drift findings between Total's current doc comment and its code.


All features | CLI reference | IDE menus