doc-returns-required
What it does
Section titled “What it does”Reports a documented method or delegate that does not return void and has no <returns> (and no <inheritdoc />). Private members are not reported. No fix.
Why it matters
Section titled “Why it matters”The summary says what a method does, and <returns> says what comes back, which a caller needs to use it right: units, meaning of null, which failure value.
To fix, add a <returns> that describes the value.
Example
Section titled “Example”... /// <summary>Returns.</summary> public int NoReturns() => 0; /// <summary>Returns.</summary>... /// <summary>Does.</summary> public Task AsyncNoReturns() => null; /// <summary>Does.</summary>... /// <summary>Does.</summary> internal int InternalNoReturns() => 0; /// <summary>Does.</summary> protected int ProtectedNoReturns() => 0; /// <summary>Does.</summary>... /// <summary>Delegate.</summary> public delegate int Callback(); /// <summary>Delegate.</summary>... /// <summary>Does.</summary> public ref int RefReturn() => throw null;}Configuration
Section titled “Configuration”csharp: lint: rules: doc-returns-required: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line doc-returns-required in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| StyleCop | SA1615 |
full |