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/SA1509.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,23 +21,43 @@ An opening brace within a C# element, statement, or expression is preceded by a
21
21
22
22
## Rule description
23
23
24
-
To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits blank lines in other situations. This results in a consistent visual pattern across the code, which can improve recognition and readability of unfamiliar code.
24
+
To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits blank lines
25
+
in other situations. This results in a consistent visual pattern across the code, which can improve recognition and
26
+
readability of unfamiliar code.
25
27
26
-
A violation of this rule occurs when an opening brace is preceded by a blank line. For example:
28
+
In general, a violation of this rule occurs when an opening brace is preceded by a blank line. For example, the
29
+
following above would generate two instances of this violation, since there are two places where opening braces are
30
+
preceded by blank lines.
27
31
28
32
```csharp
29
33
publicboolEnabled
30
34
31
35
{
32
-
get
36
+
get
33
37
34
-
{
35
-
returnthis.enabled;
38
+
{
39
+
returnthis.enabled;
36
40
}
37
41
}
38
42
```
39
43
40
-
The code above would generate two instances of this violation, since there are two places where opening braces are preceded by blank lines.
44
+
An exception to this rule occurs when the opening brace is preceded by a closing brace. When this occurs, a blank line
45
+
will be required by [SA1513](SA1513.md). The following example shows correct use of blank lines:
Copy file name to clipboardExpand all lines: documentation/SA1513.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,20 +21,24 @@ A closing brace within a C# element, statement, or expression is not followed by
21
21
22
22
## Rule description
23
23
24
-
To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits blank lines in other situations. This results in a consistent visual pattern across the code, which can improve recognition and readability of unfamiliar code.
24
+
To improve the readability of the code, StyleCop requires blank lines in certain situations, and prohibits blank lines
25
+
in other situations. This results in a consistent visual pattern across the code, which can improve recognition and
26
+
readability of unfamiliar code.
25
27
26
-
A violation of this rule occurs when a closing brace is not followed by a blank line. For example:
28
+
A violation of this rule occurs when a closing brace is not followed by a blank line. For example, the following code
29
+
would generate one instance of this violation, since there is one place where a closing brace is not followed by a blank
30
+
line.
27
31
28
32
```csharp
29
33
publicboolEnabled
30
34
{
31
-
get
32
-
{
33
-
returnthis.enabled;
35
+
get
36
+
{
37
+
returnthis.enabled;
34
38
}}
35
39
```
36
40
37
-
The code above would generate one instance of this violation, since there is one place where a closing brace is not followed by a blank line.
0 commit comments