Wider built-in rules (1.51)
Six built-in rules read more constructs: code-page and label exemptions, named zero constants, implied else-if, thread dialogs, Supports aliases.
Read this when you want to know which constructs six built-in lint rules newly report or exempt in version 1.51.
How to run it
drag-lint lint <path> [--profile <name>] [--target-compiler <ver|auto>] [--rule <id>|help] [--disable id1,id2] [--rules-dir <dir>] [--json] [--labels] [--no-preprocess] [--library-db <lib.sqlite>] [--build-config <name>] [--no-budget]
Full flag list: lint in the CLI reference.
Where to click
No IDE surface: this feature runs from the CLI (see How to run it).
Details
Six built-in rules read more of the source in 1.51. Defaults are unchanged: a rule that was ON stays ON, an OFF rule stays OFF.
What changed
magic-literalno longer fires on a string code page (AnsiString(1252)), a label declaration, a numeric label or agototarget.division-by-zero-literalalso reportsX / ZwhereZis a constant of the same file declared as 0.divandmodby a zero constant are left to the compiler (E2098).repeated-else-if-conditionalso reports a branch whose condition is already implied by an earlier one:if A or B ... else if A, andif A ... else if A and B.ui-access-in-threadalso reportsShowMessage,ShowMessageFmt,MessageDlg,MessageDlgPos,.ShowModaland.Invalidateinside aTThread.Execute.missing-inherited-ctor/missing-inherited-dtoralso checkAfterConstructionandBeforeDestructionoverrides. A body that touchesRefCount(theTInterfacedObjectidiom) is skipped.interface-object-mixing(OFF by default) also follows the variable thatSupports(X, IFoo, V)assigns, and reportsDisposeOfon an interface-held object.
Try it
drag-lint lint <file.pas> --rule division-by-zero-literal
drag-lint lint <file.pas> --rule repeated-else-if-condition
drag-lint lint <file.pas> --enable interface-object-mixing