TypeName | SA1505OpeningBracesMustNotBeFollowedByBlankLine |
CheckId | SA1505 |
Category | Layout Rules |
An opening brace within a C# element, statement, or expression is followed by a blank line.
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 an opening brace is followed by a blank line. For example:
public bool Enabled
{
get
{
return this.enabled;
}
}
The code above would generate two instances of this violation, since there are two places where opening braces are followed by blank lines.
To fix a violation of this rule, remove the blank line following the opening brace.
[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1505:OpeningBracesMustNotBeFollowedByBlankLine", Justification = "Reviewed.")]
#pragma warning disable SA1505 // OpeningBracesMustNotBeFollowedByBlankLine
#pragma warning restore SA1505 // OpeningBracesMustNotBeFollowedByBlankLine