BRO1513: Element documentation header should be preceded by blank line¶
A documentation comment is separated from the code above it by a blank line. Replaces StyleCop SA1514.
Example¶
Before¶
public class Order
{
private decimal total;
/// <summary>Gets the total.</summary>
public decimal Total => this.total;
}
After¶
public class Order
{
private decimal total;
/// <summary>Gets the total.</summary>
public decimal Total => this.total;
}
Why¶
Without a blank line, documentation looks like it belongs to the code above it.
How the fix works¶
A blank line is inserted above the documentation comment. BRO1505 adds the same line in most of these places; the two fixes give the same result.
Not reported¶
- Right after an opening brace or at the start of the file, like StyleCop.
- Right below a
//comment: the blank line would break BRO1506 (no blank line below a comment), and the two fixes would undo each other. StyleCop reports it.
Compared with StyleCop¶
Same positions as StyleCop, except documentation right below a comment.