Skip to content

inheritdoc-on-inheriting-member

C#styleno fixdefault: offcsharp/stylecop

Reports <inheritdoc /> without cref on a type that has no base list, or on a member that neither overrides nor implements anything. A constructor whose signature matches a base constructor is not reported. No fix.

inheritdoc takes the documentation from what the member inherits. If it inherits nothing, the tool has no text to copy, and the member is shown without documentation although the comment looks complete.

To fix, write the documentation, or name the source with cref.

Reported
...
Debug.Assert(true, "why");
...
}
/// <inheritdoc/>
public void Own() { }
}
}
...
After the fix
...
Debug.Assert(true, "why");
...
}
/// <inheritdoc/>
public void Own() { }
}
}
...
csharp:
lint:
rules:
inheritdoc-on-inheriting-member: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line inheritdoc-on-inheriting-member 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 SA1648 full