destructor-summary-standard-text
What it does
Section titled “What it does”Reports the summary of a finalizer that does not start with “Finalizes an instance of the <see cref="T"/> class.” The <see> is compared with the name of the type. The fix puts the standard sentence before the text and is unsafe.
Why it matters
Section titled “Why it matters”A finalizer is called by the runtime and not by code, so there is nothing to say about how it is used. The standard sentence gives every finalizer the same first line, and the text after it adds what the finalizer cleans up.
Example
Section titled “Example”.../// <summary>Destructors.</summary>public class DestructorsWrong{ /// <summary>Cleans up.</summary> ~DestructorsWrong() { }}/// <summary>Destructors.</summary>public class DestructorsOther{ /// <summary>Finalizes an instance of the <see cref="Other"/> class.</summary> ~DestructorsOther() { }}/// <summary>Destructors.</summary>.../// <summary>Destructors.</summary>public class DestructorsNoPeriod{ /// <summary>Finalizes an instance of the <see cref="DestructorsNoPeriod"/> struct.</summary> ~DestructorsNoPeriod() { }}/// <summary>Other.</summary>....../// <summary>Destructors.</summary>public class DestructorsWrong{ /// <summary>Finalizes an instance of the <see cref="DestructorsWrong"/> class. Cleans up.</summary> ~DestructorsWrong() { }}/// <summary>Destructors.</summary>public class DestructorsOther{ /// <summary>Finalizes an instance of the <see cref="DestructorsOther"/> class.</summary> ~DestructorsOther() { }}/// <summary>Destructors.</summary>.../// <summary>Destructors.</summary>public class DestructorsNoPeriod{ /// <summary>Finalizes an instance of the <see cref="DestructorsNoPeriod"/> class.</summary> ~DestructorsNoPeriod() { }}/// <summary>Other.</summary>...Configuration
Section titled “Configuration”csharp: lint: rules: destructor-summary-standard-text: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line destructor-summary-standard-text in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”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 | SA1643 |
partial | the <see cref> is compared with the name of the type by spelling, not resolved; other cultures’ texts are not available |