From 41ba81f0d5565cc32348bebaef3aa3233952d90f Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Fri, 27 Nov 2026 15:09:59 +0100 Subject: [PATCH 1/3] docs(LC0086): list contexts that are not reported Co-Authored-By: Claude Opus 5.5 --- content/docs/analyzers/LinterCop/LC0086.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/content/docs/analyzers/LinterCop/LC0086.md b/content/docs/analyzers/LinterCop/LC0086.md index b24d5dd..7a55f08 100644 --- a/content/docs/analyzers/LinterCop/LC0086.md +++ b/content/docs/analyzers/LinterCop/LC0086.md @@ -104,13 +104,17 @@ Valid `PageStyle` values: `None`, `Standard`, `StandardAccent`, `Strong`, `Stron ### Exception -The rule suppresses the diagnostic when the string literal appears in a context where it represents data or user-facing text rather than a style value: +The rule applies one fixed set of contexts to every `PageStyle` value, so you can tell from the code alone whether a literal is reported. It does not report a string literal that represents data or user-facing text rather than a style value: -- **Caption properties**: `Caption = 'Standard'` is user-facing text -- **Unlocked labels**: `Label 'Unfavorable'` without `Locked = true` is translatable text -- **StyleExpr property values**: `StyleExpr = 'Standard'` already uses the string in the correct property +- **Method arguments**: any call, built-in or your own, such as `SetRange(Code, 'None')`, `StrSubstNo('%1', 'Standard')` or `Assert.AreEqual('Strong', ...)` +- **Comparisons**: operands of `=`, `<>`, `<`, `<=`, `>`, `>=` and elements of an `in [...]` list +- **Case labels**: `'None':` or `'Attention'..'Unfavorable':` (a literal in the statement after the label is still reported) +- **Property values**: `Caption = 'Standard'`, `Description = 'Standard'`, and also `StyleExpr = 'Standard'`, which already uses the string in the correct property +- **Unlocked labels and report labels**: `Label 'Unfavorable'` or `StandardType = 'Standard';` in a report's `labels` section without `Locked = true` is translatable text - **Enum and enum value definitions**: string literals in enum contexts are identifiers -- **Table field assignments** and **data-access method arguments**: writes to data on `Record`, `RecordRef`, `FieldRef`, `Query`, and similar types +- **Table field assignments**: `Customer.Name := 'Standard'` writes data + +Assignments to other variables (including array elements and both branches of a `? :` expression), `exit('...')`, and locked labels or report labels are reported. A style value passed to a helper method as an argument, such as `SetStyle('Unfavorable')`, is not reported. In rare cases, a PascalCase string literal genuinely represents data — for example, a locked label `'Standard'` used as a configuration value. Use a pragma directive to suppress the diagnostic: From 7bf8b4a0973b237116921bf4878660e5c064f9a0 Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Fri, 27 Nov 2026 15:14:48 +0100 Subject: [PATCH 2/3] docs(LC0086): mention parenthesized comparisons and legacy report labels Co-Authored-By: Claude Opus 5.5 --- content/docs/analyzers/LinterCop/LC0086.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/analyzers/LinterCop/LC0086.md b/content/docs/analyzers/LinterCop/LC0086.md index 7a55f08..eceba3b 100644 --- a/content/docs/analyzers/LinterCop/LC0086.md +++ b/content/docs/analyzers/LinterCop/LC0086.md @@ -107,10 +107,10 @@ Valid `PageStyle` values: `None`, `Standard`, `StandardAccent`, `Strong`, `Stron The rule applies one fixed set of contexts to every `PageStyle` value, so you can tell from the code alone whether a literal is reported. It does not report a string literal that represents data or user-facing text rather than a style value: - **Method arguments**: any call, built-in or your own, such as `SetRange(Code, 'None')`, `StrSubstNo('%1', 'Standard')` or `Assert.AreEqual('Strong', ...)` -- **Comparisons**: operands of `=`, `<>`, `<`, `<=`, `>`, `>=` and elements of an `in [...]` list +- **Comparisons**: operands of `=`, `<>`, `<`, `<=`, `>`, `>=` and elements of an `in [...]` list, also in parentheses or as part of a range - **Case labels**: `'None':` or `'Attention'..'Unfavorable':` (a literal in the statement after the label is still reported) - **Property values**: `Caption = 'Standard'`, `Description = 'Standard'`, and also `StyleExpr = 'Standard'`, which already uses the string in the correct property -- **Unlocked labels and report labels**: `Label 'Unfavorable'` or `StandardType = 'Standard';` in a report's `labels` section without `Locked = true` is translatable text +- **Unlocked labels and report labels**: `Label 'Unfavorable'` or `StandardType = 'Standard';` in a report's `labels` section without `Locked = true` is translatable text, and so is the legacy `label(StandardType; ENU = 'Standard')` form - **Enum and enum value definitions**: string literals in enum contexts are identifiers - **Table field assignments**: `Customer.Name := 'Standard'` writes data From 55aa287287cd3f1884f389ab6fc4ef3ad01288eb Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Fri, 27 Nov 2026 15:20:08 +0100 Subject: [PATCH 3/3] docs(LC0086): mention ternary operands, attribute arguments and TextConst Co-Authored-By: Claude Opus 5.5 --- content/docs/analyzers/LinterCop/LC0086.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/docs/analyzers/LinterCop/LC0086.md b/content/docs/analyzers/LinterCop/LC0086.md index eceba3b..abae89e 100644 --- a/content/docs/analyzers/LinterCop/LC0086.md +++ b/content/docs/analyzers/LinterCop/LC0086.md @@ -106,11 +106,12 @@ Valid `PageStyle` values: `None`, `Standard`, `StandardAccent`, `Strong`, `Stron The rule applies one fixed set of contexts to every `PageStyle` value, so you can tell from the code alone whether a literal is reported. It does not report a string literal that represents data or user-facing text rather than a style value: -- **Method arguments**: any call, built-in or your own, such as `SetRange(Code, 'None')`, `StrSubstNo('%1', 'Standard')` or `Assert.AreEqual('Strong', ...)` -- **Comparisons**: operands of `=`, `<>`, `<`, `<=`, `>`, `>=` and elements of an `in [...]` list, also in parentheses or as part of a range +- **Method and attribute arguments**: any call, built-in or your own, such as `SetRange(Code, 'None')`, `StrSubstNo('%1', 'Standard')` or `Assert.AreEqual('Strong', ...)`, and attribute arguments such as an event name in `[EventSubscriber(...)]` +- **Comparisons**: operands of `=`, `<>`, `<`, `<=`, `>`, `>=` and elements of an `in [...]` list, also in parentheses, as part of a range, or as a branch of a `? :` expression - **Case labels**: `'None':` or `'Attention'..'Unfavorable':` (a literal in the statement after the label is still reported) - **Property values**: `Caption = 'Standard'`, `Description = 'Standard'`, and also `StyleExpr = 'Standard'`, which already uses the string in the correct property -- **Unlocked labels and report labels**: `Label 'Unfavorable'` or `StandardType = 'Standard';` in a report's `labels` section without `Locked = true` is translatable text, and so is the legacy `label(StandardType; ENU = 'Standard')` form +- **Unlocked labels and report labels**: `Label 'Unfavorable'` or `StandardType = 'Standard';` in a report's `labels` section without `Locked = true` is translatable text +- **Multilanguage text**: `TextConst ENU = 'Standard'` and the legacy `label(StandardType; ENU = 'Standard')` report label, which have no `Locked` option - **Enum and enum value definitions**: string literals in enum contexts are identifiers - **Table field assignments**: `Customer.Name := 'Standard'` writes data