-
Notifications
You must be signed in to change notification settings - Fork 23
SA1507
TypeName |
CodeMustNotContainMultipleBlankLinesInARow |
CheckId |
SA1507 |
Category |
Layout Rules |
The C# code contains multiple blank lines in a row.
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 the code contains more than one blank line in a row. For example:
public bool Enabled
{
get
{
Console.WriteLine("Getting the enabled flag.");
return this.enabled;
}
}
The code above would generate an instance of this violation, since it contains blank multiple lines in a row.
To fix a violation of this rule, remove the extra blank lines.
[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1507:CodeMustNotContainMultipleBlankLinesInARow", Justification = "Reviewed.")]
- - SA0102 - Clean Install
- - Download
- - Documentation Rules - Layout Rules - Maintainability Rules - Naming Rules - Ordering Rules - Readability Rules - Spacing Rules - Suppressions
- - Adding a custom StyleCop settings page - Adding custom rule settings - Authoring a custom styleCop rule - Authoring rules metadata - Custom CSharp Language Service - Custom MSBuild Integration - Hosting StyleCop in a Custom Environment - Installing a Custom Rule - Integrating StyleCop Into Build Environments - Integrating StyleCop into MSBuild - Writing Custom Rules for StyleCop