Delphi-RAG-Lint

drag-lint help

Lint rule: form no menu or click reaches (form-no-ui-path)

Since: 1.64.0-alpha

Project-wide lint rule: a form of the program that no menu / click path from the main form reaches (forms-csv walker, registries and by-name lookups excluded).

Read this to see when form-no-ui-path reports a form, which possible callers (popupForms, class registries, FindClass by name, the .dpr) keep it quiet, and how to accept a finding.

How to run it

drag-lint lint-all [--profile <name>] [--target-compiler <ver|auto>] [--db <file.sqlite>] [--project <.dproj>] [--build-config <name>] [--rule <id>[,<id>...]] [--disable id,...] [--output <report.txt>] [--json] [--labels] [--quiet] [--lint-third-party] [--no-preprocess] [--shared-db <db> ...] [--library-db none] [--no-budget] [--changed-since <rev>]

Example:

drag-lint lint-all --db <project.sqlite> --project <App.dproj>

Full flag list: lint-all in the CLI reference.

drag-lint lint-all [--profile <name>] [--target-compiler <ver|auto>] [--db <file.sqlite>] [--project <.dproj>] [--build-config <name>] [--rule <id>[,<id>...]] [--disable id,...] [--output <report.txt>] [--json] [--labels] [--quiet] [--lint-third-party] [--no-preprocess] [--shared-db <db> ...] [--library-db none] [--no-budget] [--changed-since <rev>]

Example:

drag-lint lint-all --db <project.sqlite> --project <App.dproj> --rule form-no-ui-path

Full flag list: lint-all in the CLI reference.

Where to click

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

Details

A project-wide lint rule (1.64, lane NOUI, rules plan row D1, owner request 2026-11-30). It reports a form of a program that no menu / ribbon / toolbar / tab / button path from the main form reaches. Category project-wide, severity warning, ON by default, lint-all only.

Running it

drag-lint lint-all --db <project.sqlite> --project <App.dproj>
drag-lint lint-all --db <project.sqlite> --project <App.dproj> --rule form-no-ui-path
drag-lint lint-all --db <project.sqlite> --disable form-no-ui-path

Without --project the rule uses the one .dpr among the files lint-all walks; with none, or more than one, it stays silent.

How it decides

The rule does not trace navigation itself. It runs the same walker as drag-lint forms-csv (algorithm v10: menu, ribbon, toolbar, tab and code-added items, index first, text scan as the fallback) and reads back every row whose Confidence is unresolved:

  • no caller found -- nothing in the project opens the form;
  • found by: ... -- some form opens it, but no chain of such forms starts at the main form (an orphan opening another orphan).

A handler-only row (the form is opened by a timer, an action or other code with no captioned control) is not this rule.

What is NOT reported (a possible caller the walker cannot see)

  • popupForms: a form declared in <project folder>\_D-RAG\drag-lint-project.json under "popupForms".
  • Class registries and factories: the form class used as a metaclass VALUE anywhere in the project -- an element of a TFormClass array or list (array[..] of TFormClass = (TfrmA, TfrmB), the ID picked by a slider or combo indexes it), an argument (RegisterClass(TfrmX), Registry.Add(ID, TfrmX), ShowForm(TfrmX)), the right side of :=, a RegisterType<TfrmX> / Resolve<TfrmX> generic argument (Spring4D).
  • By name: a string literal equal to the class name (FindClass('TfrmX'), GetClass('TfrmX')).
  • The .dpr: the main form, and a form the .dpr itself creates or shows (TfrmSplash.Create, frmLogin.ShowModal).

A plain type use does not count as a caller: AForm: TfrmX, Sender is TfrmX, TObjectList<TfrmX>, the heritage class(TfrmX).

What to do with a finding

The message names the form and its class. If the form really is opened by a class registry, by a name read from a file or database, or by another mechanism the tool cannot see, declare it in popupForms (with a note on how it opens) or put the class in a registry the project names; or accept it with a review marker on the class line:

  TfrmX = class(TForm)  // dl:ok form-no-ui-path@<hash> -- opened by name from the plug-in table

Otherwise the form is dead: remove it, or wire it to a menu item.

Limits

  • A registry counts as a caller even when the registry itself is unreachable (the rule does not check that the registry is reached from the UI).
  • The walker reads the index of this project only; a form opened from code in another project's index (for example a COMMON unit indexed separately) reads as unresolved -- forms-csv prints a stderr note when that happens.
  • A library or package project is skipped.

Test: tests\autotest\run_v164_NOUI.ps1 on tests\fixtures\v164\noui.


All features | CLI reference | IDE menus