Skip to content

doc-partial-typeparams

C#styleno fixdefault: offcsharp/stylecop

Reports a documented partial generic type (one that has a <summary>) that has no <typeparam> for one of its type parameters, on the parameter. Each part is checked on its own. No fix.

Without the tag a reader of the documentation sees T and has to read the code to learn what it stands for.

To fix, add <typeparam name="T"> with the meaning of T.

Reported
...
public delegate void GenericCallback<T, U>();
/// <summary>Partial.</summary>
/// <typeparam name="T">The T.</typeparam>
public partial class PartialGeneric<T, U> { }
/// <summary>Partial.</summary>
public partial class PartialGenericNone<T> { }
/// <summary>Partial.</summary>
/// <typeparam name="U">The U.</typeparam>
internal partial struct PartialGenericStruct<T, U> { }
/// <summary>Partial.</summary>
/// <typeparam name="T">The T.</typeparam>
/// <typeparam name="U">The U.</typeparam>
...
csharp:
lint:
rules:
doc-partial-typeparams: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-partial-typeparams 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 SA1619 partial each part of a partial generic type is checked on its own