Skip to content

Commit 2ee7181

Browse files
committed
Fixed malformed description warnings
1 parent 762b8fc commit 2ee7181

File tree

2 files changed

+52
-52
lines changed

2 files changed

+52
-52
lines changed

CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@ public static class DiagnosticDescriptors
1919
/// </summary>
2020
public static readonly DiagnosticDescriptor SamplePaneOptionAttributeOnNonSample = new(
2121
id: "TKSMPL0001",
22-
title: $"Invalid sample option declaration",
23-
messageFormat: $"Cannot generate sample pane options for type {{0}} as it does not use {nameof(Attributes.ToolkitSampleAttribute)}",
22+
title: "Invalid sample option declaration",
23+
messageFormat: "Cannot generate sample pane options for type {{0}} as it does not use ToolkitSampleAttribute",
2424
category: typeof(ToolkitSampleMetadataGenerator).FullName,
2525
defaultSeverity: DiagnosticSeverity.Error,
2626
isEnabledByDefault: true,
27-
description: $"Cannot generate sample pane options for a type which does not use {nameof(Attributes.ToolkitSampleAttribute)}.");
27+
description: "Cannot generate sample pane options for a type which does not use ToolkitSampleAttribute.");
2828

2929
/// <summary>
3030
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a derived <see cref="Attributes.ToolkitSampleOptionBaseAttribute"/> with an empty or invalid name.
3131
/// <para>
32-
/// Format: <c>"Cannot generate sample pane options for type {0} as it contains an empty or invalid name."</c>.
32+
/// Format: <c>"Cannot generate sample pane options for type {0} as it contains an empty or invalid name"</c>.
3333
/// </para>
3434
/// </summary>
3535
public static readonly DiagnosticDescriptor SamplePaneOptionWithBadName = new(
3636
id: "TKSMPL0002",
37-
title: $"Invalid sample option declaration",
38-
messageFormat: $"Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid",
37+
title: "Invalid sample option declaration",
38+
messageFormat: "Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid",
3939
category: typeof(ToolkitSampleMetadataGenerator).FullName,
4040
defaultSeverity: DiagnosticSeverity.Error,
4141
isEnabledByDefault: true,
42-
description: $"Cannot generate sample pane options when the provided name is empty or invalid.");
42+
description: "Cannot generate sample pane options when the provided name is empty or invalid.");
4343

4444
/// <summary>
4545
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a <see cref="Attributes.ToolkitSampleOptionsPaneAttribute"/> with a <see cref="Attributes.ToolkitSampleOptionsPaneAttribute.SampleId"/> that doesn't have a corresponding <see cref="Attributes.ToolkitSampleAttribute.Id"/>.
@@ -49,12 +49,12 @@ public static class DiagnosticDescriptors
4949
/// </summary>
5050
public static readonly DiagnosticDescriptor OptionsPaneAttributeWithMissingOrInvalidSampleId = new(
5151
id: "TKSMPL0003",
52-
title: $"Missing or invalid sample Id",
53-
messageFormat: $"Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known {nameof(Attributes.ToolkitSampleAttribute)}",
52+
title: "Missing or invalid sample Id",
53+
messageFormat: "Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known ToolkitSampleAttribute",
5454
category: typeof(ToolkitSampleMetadataGenerator).FullName,
5555
defaultSeverity: DiagnosticSeverity.Error,
5656
isEnabledByDefault: true,
57-
description: $"Cannot link sample options pane to a provided sample ID that does not match any known {nameof(Attributes.ToolkitSampleAttribute)}.");
57+
description: "Cannot link sample options pane to a provided sample ID that does not match any known ToolkitSampleAttribute.");
5858

5959
/// <summary>
6060
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a derived <see cref="Attributes.ToolkitSampleOptionBaseAttribute"/> that contains a name which is already in use by another sample option.
@@ -64,12 +64,12 @@ public static class DiagnosticDescriptors
6464
/// </summary>
6565
public static readonly DiagnosticDescriptor SamplePaneOptionWithDuplicateName = new(
6666
id: "TKSMPL0004",
67-
title: $"Duplicate sample option name",
68-
messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option",
67+
title: "Duplicate sample option name",
68+
messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option",
6969
category: typeof(ToolkitSampleMetadataGenerator).FullName,
7070
defaultSeverity: DiagnosticSeverity.Error,
7171
isEnabledByDefault: true,
72-
description: $"Cannot generate sample pane option when the provided name is used by another sample option.");
72+
description: "Cannot generate sample pane option when the provided name is used by another sample option.");
7373

7474
/// <summary>
7575
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a derived <see cref="Attributes.ToolkitSampleOptionBaseAttribute"/> that contains a name which is already defined as a member in the attached class.
@@ -79,12 +79,12 @@ public static class DiagnosticDescriptors
7979
/// </summary>
8080
public static readonly DiagnosticDescriptor SamplePaneOptionWithConflictingName = new(
8181
id: "TKSMPL0005",
82-
title: $"Conflicting sample option name",
83-
messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class",
82+
title: "Conflicting sample option name",
83+
messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class",
8484
category: typeof(ToolkitSampleMetadataGenerator).FullName,
8585
defaultSeverity: DiagnosticSeverity.Error,
8686
isEnabledByDefault: true,
87-
description: $"Cannot generate sample pane option when the provided name is already defined as a member in the attached class.");
87+
description:"Cannot generate sample pane option when the provided name is already defined as a member in the attached class.");
8888

8989
/// <summary>
9090
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a <see cref="Attributes.ToolkitSampleMultiChoiceOptionAttribute"/> that has no defined options to present to the user.
@@ -94,117 +94,117 @@ public static class DiagnosticDescriptors
9494
/// </summary>
9595
public static readonly DiagnosticDescriptor SamplePaneMultiChoiceOptionWithNoChoices = new(
9696
id: "TKSMPL0006",
97-
title: $"Missing choices in multi-choice sample option",
98-
messageFormat: $"Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided.",
97+
title: "Missing choices in multi-choice sample option",
98+
messageFormat: "Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided",
9999
category: typeof(ToolkitSampleMetadataGenerator).FullName,
100100
defaultSeverity: DiagnosticSeverity.Error,
101101
isEnabledByDefault: true,
102-
description: $"Cannot generate multiple choice sample pane option as there are no choices provided.");
102+
description: "Cannot generate multiple choice sample pane option as there are no choices provided.");
103103

104104
/// <summary>
105105
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a <see cref="Attributes.ToolkitSampleAttribute"/> that was used on an unsupported type.
106106
/// <para>
107-
/// Format: <c>"Cannot generate sample metadata as the attribute was used on an unsupported type."</c>.
107+
/// Format: <c>"Cannot generate sample metadata as the attribute was used on an unsupported type"</c>.
108108
/// </para>
109109
/// </summary>
110110
public static readonly DiagnosticDescriptor SampleAttributeOnUnsupportedType = new(
111111
id: "TKSMPL0007",
112-
title: $"ToolkitSampleAttribute declared on an invalid type",
113-
messageFormat: $"Cannot generate sample metadata as the attribute was used on an unsupported type",
112+
title: "ToolkitSampleAttribute declared on an invalid type",
113+
messageFormat: "Cannot generate sample metadata as the attribute was used on an unsupported type",
114114
category: typeof(ToolkitSampleMetadataGenerator).FullName,
115115
defaultSeverity: DiagnosticSeverity.Error,
116116
isEnabledByDefault: true,
117-
description: $"Cannot generate sample metadata as the attribute was used on an unsupported type.");
117+
description: "Cannot generate sample metadata as the attribute was used on an unsupported type.");
118118

119119
/// <summary>
120120
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a <see cref="Attributes.ToolkitSampleOptionsPaneAttribute"/> that was used on an unsupported type.
121121
/// <para>
122-
/// Format: <c>"Cannot generate options pane metadata as the attribute was used on an unsupported type."</c>.
122+
/// Format: <c>"Cannot generate options pane metadata as the attribute was used on an unsupported type"</c>.
123123
/// </para>
124124
/// </summary>
125125
public static readonly DiagnosticDescriptor SampleOptionPaneAttributeOnUnsupportedType = new(
126126
id: "TKSMPL0008",
127-
title: $"Toolkit sample options pane declared on an invalid type",
128-
messageFormat: $"Cannot generate options pane metadata as the attribute was used on an unsupported type",
127+
title: "Toolkit sample options pane declared on an invalid type",
128+
messageFormat: "Cannot generate options pane metadata as the attribute was used on an unsupported type",
129129
category: typeof(ToolkitSampleMetadataGenerator).FullName,
130130
defaultSeverity: DiagnosticSeverity.Error,
131131
isEnabledByDefault: true,
132-
description: $"Cannot generate options pane metadata as the attribute was used on an unsupported type.");
132+
description: "Cannot generate options pane metadata as the attribute was used on an unsupported type.");
133133

134134
/// <summary>
135135
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a derived <see cref="Attributes.ToolkitSampleOptionBaseAttribute"/> that was used on an unsupported type.
136136
/// <para>
137-
/// Format: <c>"Cannot generate sample option metadata as the attribute was used on an unsupported type."</c>.
137+
/// Format: <c>"Cannot generate sample option metadata as the attribute was used on an unsupported type"</c>.
138138
/// </para>
139139
/// </summary>
140140
public static readonly DiagnosticDescriptor SampleGeneratedOptionAttributeOnUnsupportedType = new(
141141
id: "TKSMPL0009",
142-
title: $"Toolkit sample option declared on an invalid type",
143-
messageFormat: $"Cannot generate sample option metadata as the attribute was used on an unsupported type",
142+
title: "Toolkit sample option declared on an invalid type",
143+
messageFormat: "Cannot generate sample option metadata as the attribute was used on an unsupported type",
144144
category: typeof(ToolkitSampleMetadataGenerator).FullName,
145145
defaultSeverity: DiagnosticSeverity.Error,
146146
isEnabledByDefault: true,
147-
description: $"Cannot generate sample option metadata as the attribute was used on an unsupported type.");
147+
description: "Cannot generate sample option metadata as the attribute was used on an unsupported type.");
148148

149149
/// <summary>
150150
/// Gets a <see cref="DiagnosticDescriptor"/> indicating an exception occured while parsing the front matter of a markdown sample file.
151151
/// </summary>
152152
public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterException = new(
153153
id: "TKSMPL0010",
154-
title: $"Invalid YAML Front Matter",
155-
messageFormat: $"Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}",
154+
title: "Invalid YAML Front Matter",
155+
messageFormat: "Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}",
156156
category: typeof(ToolkitSampleMetadataGenerator).FullName,
157157
defaultSeverity: DiagnosticSeverity.Error,
158158
isEnabledByDefault: true,
159-
description: $"Cannot generate sample page info due to a YAML Front Matter parsing exception.");
159+
description: "Cannot generate sample page info due to a YAML Front Matter parsing exception.");
160160

161161
/// <summary>
162162
/// Gets a <see cref="DiagnosticDescriptor"/> indicating an expected piece of metadata was missing from the front matter of a markdown sample file.
163163
/// </summary>
164164
public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterMissingField = new(
165165
id: "TKSMPL0011",
166-
title: $"Missing YAML Front Matter",
167-
messageFormat: $"Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter.",
166+
title: "Missing YAML Front Matter",
167+
messageFormat: "Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter",
168168
category: typeof(ToolkitSampleMetadataGenerator).FullName,
169169
defaultSeverity: DiagnosticSeverity.Error,
170170
isEnabledByDefault: true,
171-
description: $"Cannot generate sample page info due to missing YAML Front Matter.");
171+
description: "Cannot generate sample page info due to missing YAML Front Matter.");
172172

173173
/// <summary>
174174
/// Gets a <see cref="DiagnosticDescriptor"/> indicating the sample referenced in the Markdown file couldn't be found.
175175
/// </summary>
176176
public static readonly DiagnosticDescriptor MarkdownSampleIdNotFound = new(
177177
id: "TKSMPL0012",
178-
title: $"Sample Id Not Found from Markdown Reference",
179-
messageFormat: $"Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'.",
178+
title: "Sample Id Not Found from Markdown Reference",
179+
messageFormat: "Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'",
180180
category: typeof(ToolkitSampleMetadataGenerator).FullName,
181181
defaultSeverity: DiagnosticSeverity.Error,
182182
isEnabledByDefault: true,
183-
description: $"Cannot link sample page info due to invalid/unknown id.");
183+
description: "Cannot link sample page info due to invalid or unknown id.");
184184

185185
/// <summary>
186186
/// Gets a <see cref="DiagnosticDescriptor"/> indicating the sample is not referenced in any Markdown documentation files.
187187
/// </summary>
188188
public static readonly DiagnosticDescriptor SampleNotReferencedInMarkdown = new(
189189
id: "TKSMPL0013",
190-
title: $"Sample Not Referenced In Documentation",
191-
messageFormat: $"The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app.",
190+
title: "Sample Not Referenced In Documentation",
191+
messageFormat: "The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app",
192192
category: typeof(ToolkitSampleMetadataGenerator).FullName,
193193
defaultSeverity: DiagnosticSeverity.Warning,
194194
isEnabledByDefault: true,
195-
description: $"Cannot find reference to the sample within the documentation.");
195+
description: "Cannot find reference to the sample within the documentation.");
196196

197197
/// <summary>
198198
/// Gets a <see cref="DiagnosticDescriptor"/> indicating the documentation file contains no sample references.
199199
/// </summary>
200200
public static readonly DiagnosticDescriptor DocumentationHasNoSamples = new(
201201
id: "TKSMPL0014",
202-
title: $"Documentation Has No Samples",
203-
messageFormat: $"The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page.",
202+
title: "Documentation Has No Samples",
203+
messageFormat: "The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page",
204204
category: typeof(ToolkitSampleMetadataGenerator).FullName,
205205
defaultSeverity: DiagnosticSeverity.Warning,
206206
isEnabledByDefault: true,
207-
description: $"Document contains no interactive sample code.");
207+
description: "Document contains no interactive sample code.");
208208

209209
/// <summary>
210210
/// Gets a <see cref="DiagnosticDescriptor"/> indicating a sample ID is already in use by another sample.
@@ -214,10 +214,10 @@ public static class DiagnosticDescriptors
214214
/// </summary>
215215
public static readonly DiagnosticDescriptor SampleIdAlreadyInUse = new(
216216
id: "TKSMPL0015",
217-
title: $"Sample ID already in use",
218-
messageFormat: $"Cannot generate sample with id {{0}} as the provided id is already in use by another sample",
217+
title: "Sample ID already in use",
218+
messageFormat: "Cannot generate sample with id {{0}} as the provided id is already in use by another sample",
219219
category: typeof(ToolkitSampleMetadataGenerator).FullName,
220220
defaultSeverity: DiagnosticSeverity.Error,
221221
isEnabledByDefault: true,
222-
description: $"Cannot generate sample as the id is already in use by another sample.");
222+
description: "Cannot generate sample as the id is already in use by another sample.");
223223
}

CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public static class DiagnosticDescriptors
1919
/// </summary>
2020
public static readonly DiagnosticDescriptor TestControlHasConstructorWithParameters = new(
2121
id: "LUITM0001",
22-
title: $"Provided control must not have a constructor with parameters.",
23-
messageFormat: $"Cannot generate test with control {{0}} as it has a constructor with parameters.",
22+
title: "Provided control must not have a constructor with parameters.",
23+
messageFormat: "Cannot generate test with control {{0}} as it has a constructor with parameters",
2424
category: typeof(UIThreadTestMethodGenerator).FullName,
2525
defaultSeverity: DiagnosticSeverity.Error,
2626
isEnabledByDefault: true,
27-
description: $"Cannot generate test method with provided control.");
27+
description: "Cannot generate test method with provided control.");
2828
}

0 commit comments

Comments
 (0)