You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/Configuration.md
+8
Original file line number
Diff line number
Diff line change
@@ -420,6 +420,7 @@ The following properties are used to configure layout rules in StyleCop Analyzer
420
420
| --- | --- | --- | --- |
421
421
|`newlineAtEndOfFile`|`"allow"`| 1.0.0 | Specifies the handling for newline characters which appear at the end of a file |
422
422
|`allowConsecutiveUsings`|`true`| 1.1.0 | Specifies if SA1519 will allow consecutive using statements without braces |
423
+
|`allowDoWhileOnClosingBrace`|`false`| >1.2.0 | Specifies if SA1500 will allow the `while` expression of a `do`/`while` loop to be on the same line as the closing brace, as is generated by the default code snippet of Visual Studio |
423
424
424
425
### Lines at End of File
425
426
@@ -441,6 +442,13 @@ The `allowConsecutiveUsings` property specifies the behavior:
441
442
This only allows omitting the braces for a using followed by another using statement. A using statement followed by any other type of statement will still
442
443
require braces to used.
443
444
445
+
### Do-While Loop Placement
446
+
447
+
The behavior of [SA1500](SA1500.md) can be customized regarding the manner in which the `while` expression of a `do`/`while` loop is allowed to be placed. The `allowDoWhileOnClosingBrace` property specified the behavior:
448
+
449
+
*`true`: the `while` expression of a `do`/`while` loop may be placed on the same line as the closing brace or on a separate line
450
+
*`false`: the `while` expression of a `do`/`while` loop must be on a separate line from the closing brace
451
+
444
452
## Documentation Rules
445
453
446
454
This section describes the features of documentation rules which can be configured in **stylecop.json**. Each of the described properties are configured in the `documentationRules` object, which is shown in the following sample file.
Copy file name to clipboardExpand all lines: documentation/SA1500.md
+2
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@
19
19
20
20
The opening or closing brace within a C# statement, element, or expression is not placed on its own line.
21
21
22
+
> :memo: The behavior of this rule can change based on the configuration of the `allowDoWhileOnClosingBrace` property in **stylecop.json**. See [Configuration.md](Configuration.md#Layout-Rules) for more information.
23
+
22
24
## Rule description
23
25
24
26
A violation of this rule occurs when the opening or closing brace within a statement, element, or expression is not placed on its own line. For example:
0 commit comments