Skip to content

doc-text-ends-with-period

C#stylefix: safedefault: offcsharp/stylecop

Reports the last text of an element of a documentation comment that does not end with a period (. or .)). Each paragraph of <para> and <note> is checked. A paragraph that ends in a colon (except the last), -or- and <seealso> are not reported, and an inline element (<see />, <c>, …) at the end counts as not ending with a period. The fix adds the period, or replaces a trailing comma or semicolon with it.

Documentation is read as sentences in the generated reference, where the elements are shown one below the other. Text with and without the final period looks uneven, and the missing period is the first thing that shows that a sentence was not finished.

Reported
using System;
/// <summary>Interface</summary>
public interface IFace
{
/// <summary>Member</summary>
void Run();
}
/// <summary>Record</summary>
public record Record(int A);
After the fix
using System;
/// <summary>Interface.</summary>
public interface IFace
{
/// <summary>Member.</summary>
void Run();
}
/// <summary>Record.</summary>
public record Record(int A);
csharp:
lint:
rules:
doc-text-ends-with-period: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-text-ends-with-period in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
StyleCop SA1629 full