Delphi-RAG-Lint
Delphi tooling · legacy code

One Baseline, However You Type the Path

A baseline is a list of findings you have already accepted, so the next lint run shows only what your change added. Up to 1.58 that list quietly depended on how you had typed the file path when you wrote it. In 1.59 it does not: the same baseline is honoured by lint, lint-all, a full path and the IDE.

Availability

The fix is new in drag-lint 1.59.0-alpha, released 2026-11-29. Every output below is real output: the 1.59 runs on the deployed 1.59.0-alpha engine, the 1.58 runs on the 1.58.0-alpha release engine, both on the same one-unit fixture (paths shortened to ..., progress lines left out). For what a baseline is and how to use it, see Lint Only What Your Change Added.

A baseline is only useful if it is boring: write it once, and from then on every run, on the command line, in a build script or in the IDE, hides the same old findings. The case where it was not boring turned up on Micronite, which we develop as quality and production-control software for manufacturing companies: a baseline written from the project folder with a short path hid nothing when the same unit was linted by its full path.

01 — The fixture

One unit, four old findings

Invoices.pas has an empty except (reported by two rules), a StrToCurr without a TFormatSettings and an unused local. Index it and write the baseline with a relative path, as you would from the project folder:

drag-lint index . --db fix.sqlite
drag-lint lint Invoices.pas --db fix.sqlite --write-baseline lint-baseline.json
baseline written: 4 fingerprint(s) -> lint-baseline.json
02 — 1.58

The same findings come back

On 1.58, lint-all with that baseline reports all four findings again, and so does lint with the full path:

drag-lint lint-all --db fix.sqlite --baseline lint-baseline.json
...\Invoices.pas:27:5  [warning] empty-except: Empty except block silently swallows every exception -- log it or re-raise.
...\Invoices.pas:26:26  [warning] locale-sensitive-conversion: Locale-sensitive conversion without a TFormatSettings -- behaves differently per regional settings; pass an explicit TFormatSettings.
...\Invoices.pas:21:3  [hint] unused-local: H2164 Variable 'Unused' is declared but never used in 'TInvoices.Total'
...\Invoices.pas:27:5  [warning] try-except-swallowed: Exception silently swallowed -- add raise, logging, or Application.HandleException.
lint-all: 4 finding(s) -- 0 error(s), 3 warning(s), 0 info, 1 hint -- 1 file(s) scanned

Nothing in the code changed. The fingerprint of each finding included the file path exactly as typed: Invoices.pas when the baseline was written, the full path when lint-all and the IDE looked it up. Different text, different fingerprint, no match.

03 — 1.59

One canonical path

1.59 builds every fingerprint from one canonical spelling of the path: expanded to a full path and lowercased. The same baseline, written the same way, now hides the old findings everywhere:

drag-lint lint-all --db fix.sqlite --baseline lint-baseline.json
lint-all: 0 finding(s) -- 0 error(s), 0 warning(s), 0 info, 0 hint -- 1 file(s) scanned
drag-lint lint ...\Invoices.pas --db fix.sqlite --baseline lint-baseline.json
0 finding(s)
04 — The check

A new finding still shows

A baseline that hides everything would also print zero. So add one new line, Result := Result + StrToCurr('0.50');, re-index and run again:

drag-lint index . --db fix.sqlite
drag-lint lint-all --db fix.sqlite --baseline lint-baseline.json
...\Invoices.pas:24:22  [warning] locale-sensitive-conversion: Locale-sensitive conversion without a TFormatSettings -- behaves differently per regional settings; pass an explicit TFormatSettings.
lint-all: 1 finding(s) -- 0 error(s), 1 warning(s), 0 info, 0 hint -- 1 file(s) scanned

Only the new line is reported. The old StrToCurr, three lines below it on line 27, stays in the baseline.

05 — Old baselines

Baselines written before 1.59 keep working where they worked

1.59 also accepts the old fingerprint, computed from the path as the current run spells it. What that means for a baseline you already have depends on how 1.58 wrote it. One written with a full path (which is what lint-all writes) needs nothing: on 1.59 it hides the four findings in lint-all and in lint with either spelling of the path. One written by lint Invoices.pas with a relative path still matches only that same relative spelling, as it did on 1.58:

drag-lint lint Invoices.pas --db fix.sqlite --baseline lint-baseline-158.json
0 finding(s)
drag-lint lint-all --db fix.sqlite --library-db none --baseline lint-baseline-158.json
...
lint-all: 4 finding(s) -- 0 error(s), 3 warning(s), 0 info, 1 hint -- 1 file(s) scanned

So write such a baseline once more with 1.59; the new file matches everywhere. The IDE Structure form's new only box uses the same recipe, TBaseline.FingerprintOf, with the canonical path only. It honours every baseline 1.59 writes and every one 1.58 wrote with a full path. Since 1.59 it also takes the line text from the editor, not from the saved file, so a line you edit counts as new at once, before you save.

06 — How it works

A deterministic Delphi algorithm, not AI and not manual work

A fingerprint is rule, canonical file path, the trimmed text of the line and the occurrence number on that line. No line numbers, so code added above an old finding does not bring it back; no model and no guessing, so the same source gives the same fingerprints on every machine. The engine is written in Delphi.

07 — Limits

What to know before you rely on it

  • The path is lowercased, which is right on Windows. Two files whose paths differ only in case are one file to the baseline.
  • Moving or renaming a unit changes its path, so its old findings come back once. Write the baseline again after a move.
  • Editing a line changes its text, so an accepted finding on that line comes back. That is on purpose: you touched it.
  • A baseline 1.58 wrote with a relative path keeps its old reach: write it again with 1.59 (section 05).

Output measured 2026-11-29 on a one-unit fixture: sections 01, 03 and 04 with drag-lint 1.59.0-alpha, section 02 with 1.58.0-alpha, and the old baselines of section 05 written by 1.58.0-alpha and read by 1.59.0-alpha. What the IDE's new only box does is read from the plugin's source and the 1.59 release notes, not from an IDE run.