doc-returns-has-text
What it does
Section titled “What it does”Reports a <returns> without text. A comment with <inheritdoc /> is not reported. No fix.
Why it matters
Section titled “Why it matters”An empty <returns></returns> looks like documentation and tells the reader nothing about the value, and it keeps tools from reporting that the result is not described.
To fix, describe what the method returns.
Example
Section titled “Example”... /// <summary>Returns.</summary> /// <returns></returns> public int EmptyReturns() => 0; /// <summary>Returns.</summary> /// <returns /> public int SelfClosingReturns() => 0; /// <summary>Returns.</summary>... public int GoodReturns() => 0; /// <summary>Returns.</summary> /// <returns> /// </returns> public int BlankReturns() => 0;... public void VoidReturns() { } /// <summary>Does.</summary> /// <returns></returns> public void VoidEmptyReturns() { } /// <summary>Does.</summary> /// <returns /> public void VoidSelfClosingReturns() { } /// <summary>Does.</summary>...Configuration
Section titled “Configuration”csharp: lint: rules: doc-returns-has-text: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line doc-returns-has-text 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 | SA1616 |
full |