-
Notifications
You must be signed in to change notification settings - Fork 22
SA1511
TypeName |
WhileDoFooterMustNotBePrecededByBlankLine |
CheckId |
SA1511 |
Category |
Layout Rules |
The while footer at the bottom of a do-while statement is separated from the statement 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 the while keyword at the bottom of a do-while statement is separated from the main part of the statement by one or more blank lines. For example:
do
{
Console.WriteLine("Loop forever");
}
while (true);
To fix a violation of this rule, remove any blank lines before the while keyword.
[SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1511:WhileDoFooterMustNotBePrecededByBlankLine", 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