Case sensitivity¶
Whether two identifiers that differ only in case (Motor vs motor) are the same symbol is dialect-dependent. plc-st-review makes it configurable with one top-level key in .plc-st-review.yml:
Which value matches your toolchain?¶
| Toolchain | Setting | Why |
|---|---|---|
| Generic IEC 61131-3 (per the standard) | false (default) |
The standard specifies identifiers are case-insensitive. |
| CODESYS (and CODESYS-derived IDEs) | false |
CODESYS folds identifiers case-insensitively. |
| Beckhoff TwinCAT | false |
Same as CODESYS / standard. |
| B&R Automation Studio | true |
B&R treats Motor and motor as two distinct variables. |
Pick the value that matches the IDE your code is compiled in. Setting it the wrong way can either hide real bugs (too loose) or invent false ones (too strict).
What it changes¶
false — case-insensitive (default)¶
The engine treats identifiers that differ only in case as the same symbol — same as the IEC standard, same as CODESYS / TwinCAT.
- A constant declared
MaxCountis resolved when referenced asMAXCOUNT, so checks likeDIVISION_BY_ZEROandLOOP_BOUNDS_REVERSEDcan read its value. - A local
levelshadowing a globalLevelfiresVARIABLE_SHADOWING. - A standard timer parameter written
pt := T#5sis found byTIMER_PT_ZERO/TIMER_VALUE_CHANGEDeven though their lookup spells itPT. - An enum value renamed case-only (
idle→IDLE) is not flagged byENUM_VALUE_REMOVED— it's still the same value. IDENTIFIER_CASE_MISMATCHfires to flag references whose case drifted from the declaration (e.g.iCountdeclared,ICOUNTused).
true — case-sensitive (B&R)¶
Identifiers are matched exactly. A different case is a different (or undefined) symbol, not a style slip.
VARIABLE_SHADOWINGonly fires on an exact-case match between the local and the global.- An enum value renamed case-only (
idle→IDLE) is reported as a removal — it really is a different value in this dialect. IDENTIFIER_CASE_MISMATCHis automatically disabled in this mode. The right check for a case-different reference is "is this an undefined symbol?", not a style nit.
Example¶
# .plc-st-review.yml — for a TwinCAT or CODESYS project (or omit the key entirely)
case_sensitive: false
The same setting drives every identifier comparison in the engine — globals, enums, named call arguments, scope lookups — so insertion and lookup always agree.