Skip to content

doc-partial-required

C#styleno fixdefault: offcsharp/stylecop

Reports a partial type or method without a documentation comment, or with an empty one. Each part is checked on its own: accepting one documented part would need all the other parts of the project. Which elements need documentation follows the default of private members being left out.

A partial type is built from several files, and the documentation tools take the comment from one of them. A part without a comment leaves the reader of that file with nothing to read at the declaration.

To fix, document the part.

Reported
...
/// <remarks>Partial without summary.</remarks>
...
/// <summary></summary>
public partial class PartialEmptySummary { }
/// <content>Content.</content>
public partial class PartialContent { }
/// <content></content>
public partial class PartialEmptyContent { }
/// <inheritdoc />
public partial class PartialInherited { }
...
public partial class PartialDefault { }
/// <remarks>Internal partial.</remarks>
...
public partial class PartialUndocumented { }
internal partial struct PartialUndocumentedInternal { }
csharp:
lint:
rules:
doc-partial-required: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-partial-required in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
StyleCop SA1601 partial a partial type or method is reported when this part is undocumented even if another part is documented (needs the other parts)