Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.5 KB

SA1506.md

File metadata and controls

54 lines (40 loc) · 1.5 KB

SA1506

TypeName SA1506ElementDocumentationHeadersMustNotBeFollowedByBlankLine
CheckId SA1506
Category Layout Rules

Cause

An element documentation header above a C# element is 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 the element documentation header above an element is followed by a blank line. For example:

/// <summary>
/// Gets a value indicating whether the control is enabled.
/// </summary>

public bool Enabled
{
    get { return this.enabled; }
}

The code above would generate an instance of this violation, since the documentation header is followed by a blank line.

How to fix violations

To fix a violation of this rule, remove the blank line following the documentation header.

How to suppress violations

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