BSL216 — Missing spaces to the left or right of operators + - * / = % < > <> <= >=, keywords, and also to the right of , and ;¶
Summary¶
Missing spaces to the left or right of operators + - * / = % < > <> <= >=, keywords, and also to the right of , and ;
Identifiers¶
| Field | Value |
|---|---|
| Rule code | BSL216 |
| Compatible alias | MissingSpace |
| Severity | INFORMATION |
| Enabled by default | Yes |
| Implemented | Yes |
| Tags | style, convention |
Behavior¶
- The public identifier
BSL216and aliasMissingSpaceare stable. - The rule reports the cases documented on this page.
- Suppressions and project configuration are applied before publication.
- The rule requires neither an external analyzer nor network access.
Configuration and suppression¶
BSL### is the primary stable identifier. The compatible alias is accepted
in select, ignore, and compatible block suppression comments.
All three suppression families support both a current line and a range. When an opening comment follows code, it affects only that line. Use any one form:
noqa:
bsl-disable:
- compatible
BSLLSform:
When the same opening comment is on a line by itself, it starts a range. Close it with the matching marker from the same family:
// noqa: BSL216
// code without this diagnostic
// noqa-enable: BSL216
// bsl-disable: BSL216
// code without this diagnostic
// bsl-enable: BSL216
// BSLLS:MissingSpace-off
// code without this diagnostic
// BSLLS:MissingSpace-on
To disable the rule until the end of the file, omit the closing
noqa-enable, bsl-enable, or BSLLS:…-on marker.
Opening and closing markers must belong to the same family.
Description¶
To improve code readability to the left and right of operators + - * / = % < > <> <= >= there must be spaces. Also, the space should be to the right of , и ;
Examples¶
Incorrect
Correct
Using checkSpaceToRightOfUnary parameter¶
The parameter makes sense only in case the unary operator is listed in one of three base parameters.
If set to false
If set to true
Using allowMultipleCommas parameter¶
The parameter has sense only if , is listed in one of three base parameters Defaults to false
If set to false
CommonModuleClientServer.MessageToUser(MessageText,,,, Cancel); // Bad
CommonModuleClientServer.MessageToUser(MessageText, , , , Cancel); // Correct
If set to true