constructor-summary-standard-text
What it does
Section titled “What it does”Reports the summary of a constructor that does not start with the standard sentence: “Initializes a new instance of the <see cref="T"/> class” (or “struct”), “Initializes static members of the …” for a static constructor. A private constructor may say “Prevents a default instance of the … from being created”. 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 constructor needs no description of what it does that every constructor does not already say; the standard sentence gives the same first line to all of them, and the text after it adds what is special about this one. Many documentation conventions require it.
Example
Section titled “Example”...{ /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> public Constructors() { } /// <summary>Creates it.</summary> public Constructors(int a) { } /// <summary>Initializes a new instance of the <see cref="Other"/> class.</summary> public Constructors(int a, int b) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> struct.</summary> public Constructors(int a, int b, int c) { } /// <summary>Initializes a new instance of the Constructors class.</summary> public Constructors(long a) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class and more.</summary> public Constructors(long a, long b) { }... private Constructors(char a, char b) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> private Constructors(char a, char b, char c) { } /// <summary>Private.</summary> private Constructors(char a, char b, char c, char d) { } /// <summary>Prevents a default instance of the <see cref="Constructors{T}"/> class from being created.</summary> protected Constructors(byte a) { } /// <summary>Finalizes an instance of the <see cref="Constructors{T}"/> class.</summary> ~Constructors() { }......{ /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> public Constructors() { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class. Creates it.</summary> public Constructors(int a) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> public Constructors(int a, int b) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> public Constructors(int a, int b, int c) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class. Initializes a new instance of the Constructors class.</summary> public Constructors(long a) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class and more.</summary> public Constructors(long a, long b) { }... private Constructors(char a, char b) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class.</summary> private Constructors(char a, char b, char c) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class. Private.</summary> private Constructors(char a, char b, char c, char d) { } /// <summary>Initializes a new instance of the <see cref="Constructors{T}"/> class. Prevents a default instance of the <see cref="Constructors{T}"/> class from being created.</summary> protected Constructors(byte a) { } /// <summary>Finalizes an instance of the <see cref="Constructors{T}"/> class.</summary> ~Constructors() { }...Configuration
Section titled “Configuration”csharp: lint: rules: constructor-summary-standard-text: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line constructor-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 | SA1642 |
partial | the <see cref> is compared with the name of the type by spelling, not resolved (a cref through a using alias or a different qualification of the same type is not recognized); other cultures’ texts are not available |