Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.33 KB

SA1513.md

File metadata and controls

54 lines (41 loc) · 1.33 KB

SA1513

TypeName SA1513ClosingBraceMustBeFollowedByBlankLine
CheckId SA1513
Category Layout Rules

Cause

A closing brace within a C# element, statement, or expression is not followed by a blank line.

Rule description

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.

A violation of this rule occurs when a closing brace is not followed by a blank line. For example, the following code would generate one instance of this violation, since there is one place where a closing brace is not followed by a blank line.

if (condition)
{
    DoSomething();
}
return value;

How to fix violations

To fix a violation of this rule, ensure a blank line follows closing braces.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:ClosingBraceMustBeFollowedByBlankLine", Justification = "Reviewed.")]
#pragma warning disable SA1513 // ClosingBraceMustBeFollowedByBlankLine
#pragma warning restore SA1513 // ClosingBraceMustBeFollowedByBlankLine