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: StyleCop.Analyzers/StyleCop.Analyzers/LayoutRules/SA1519BracesMustNotBeOmittedFromMultiLineChildStatement.cs
Copy file name to clipboardExpand all lines: documentation/Configuration.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,7 @@ The following properties are used to configure layout rules in StyleCop Analyzer
303
303
| Property | Default Value | Summary |
304
304
| --- | --- | --- |
305
305
|`newlineAtEndOfFile`|`"allow"`| Specifies the handling for newline characters which appear at the end of a file |
306
+
|`allowConsecutiveUsings`|`true`| Specifies if SA1519 will allow consecutive using statements without braces |
306
307
307
308
### Lines at End of File
308
309
@@ -313,6 +314,17 @@ file are handled. The `newlineAtEndOfFile` property supports the following value
313
314
*`"require"`: Files are required to end with a single newline character
314
315
*`"omit"`: Files may not end with a newline character
315
316
317
+
### Consecutive using statements without braces
318
+
319
+
The behavior of [SA1519](SA1519.md) can be customized regarding the manner in which consecutive using statements without braces are treated.
320
+
The `allowConsecutiveUsings` property specifies the behavior:
321
+
322
+
*`true`: consecutive using statements without braces will not produce diagnostics
323
+
*`false`: consecutive using statements without braces will produce a SA1519 diagnostic
324
+
325
+
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
326
+
require braces to used.
327
+
316
328
## Documentation Rules
317
329
318
330
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.
0 commit comments