Delphi-RAG-Lint

drag-lint help

Object-model lint rules (Equals/hash, events, GUIDs, exports)

Since: 1.51.0-alpha

Ten single-file lint rules: Equals/GetHashCode, event calls, duplicate GUIDs, DLL exports, money as float, default params, accessors, forwards, legacy lists.

Read this to see what each object-model rule reports, which ship ON and what keeps them silent.

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>]

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

Ten rules that read one file's parse tree; none needs the index. Run them with drag-lint lint <file> or drag-lint lint-all --db <project.sqlite> --rule <id>. A rule that ships OFF is switched on with --rule <id> or "enabled" in the config.

RuleDefaultReports
equals-without-gethashcodeONA class overrides Equals(Obj) but not GetHashCode, or the reverse
event-call-without-assignedONA method calls an event field (or the property reading it) with no Assigned / <> nil test of it in the same routine; event types are T*Event, T*Notify, T*Callback, T*Handler, T*Proc or a procedural type of the file
duplicate-interface-guidONTwo interfaces of one file carry the same GUID (case-insensitive); a dispinterface sharing the GUID of its dual interface is exempt. Cross-unit duplicates wait for the GUID fact of lane EXT
dll-export-unsafeONA routine listed in exports has no stdcall / cdecl / safecall / winapi / pascal convention
money-as-floatONA field, variable, parameter or property whose name has a money word (price, preis, betrag, amount, cost ...) typed Double / Single / Extended / Real; names with percent, rate, factor, count ... are exempt
default-parameterOFFA parameter with a default value (style)
trivial-accessorOFFA getter that only returns a field, a setter that only assigns one, named by a property of the same class (non-virtual)
unneeded-forward-declarationOFFTFoo = class; / interface; whose full declaration follows in the same type block with no mention of the name between them
legacy-tlistOFFItems of a non-generic TList / TObjectList read through T(L[i]), T(L.Items[i]), T(L.First) or as T
legacy-stack-queueOFFT(S.Pop) / Peek / Extract on a non-generic stack or queue

noreturn-returns is not added: the compiler already reports W1080 for a noreturn routine that can return.


All features | CLI reference | IDE menus