no-returns-on-void
What it does
Section titled “What it does”Reports a <returns> on a method or delegate that returns void. The fix removes the element with its line when it is alone on it.
Why it matters
Section titled “Why it matters”There is nothing to return, so the tag documents a value that does not exist and is shown in the reference as a result.
Example
Section titled “Example”... /// </returns> public int BlankReturns() => 0; /// <summary>Does.</summary> /// <returns>Nothing.</returns> public void VoidReturns() { } /// <summary>Does.</summary> /// <returns></returns> public void VoidEmptyReturns() { } /// <summary>Does.</summary> /// <returns /> public void VoidSelfClosingReturns() { } /// <summary>Does.</summary>... /// <summary>Delegate.</summary>... /// <summary>Delegate.</summary> /// <returns>Nothing.</returns> public delegate void VoidCallback(); /// <summary>Does.</summary>...Configuration
Section titled “Configuration”csharp: lint: rules: no-returns-on-void: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line no-returns-on-void 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 | SA1617 |
full |