Skip to content

Commit 09e5b01

Browse files
committed
Fix RS1032 (Define diagnostic message correctly)
1 parent e2432af commit 09e5b01

8 files changed

Lines changed: 50 additions & 47 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1612UnitTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public class ClassName
132132
}";
133133

134134
var diagnostic = Diagnostic()
135-
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}.");
135+
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}");
136136

137137
var expected = new[]
138138
{
@@ -215,7 +215,7 @@ public class ClassName
215215
}";
216216

217217
var diagnostic = Diagnostic()
218-
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}.");
218+
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}");
219219

220220
var expected = new[]
221221
{
@@ -248,7 +248,7 @@ public class ClassName
248248
}";
249249

250250
var diagnostic = Diagnostic()
251-
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}.");
251+
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}");
252252

253253
var expected = diagnostic.WithLocation(13, 22).WithArguments("bar", 2);
254254

@@ -353,7 +353,7 @@ public class ClassName
353353
}";
354354

355355
var diagnostic = Diagnostic()
356-
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}.");
356+
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}");
357357

358358
var expected = new[]
359359
{
@@ -400,7 +400,7 @@ public class ClassName
400400
}";
401401

402402
var diagnostic = Diagnostic()
403-
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}.");
403+
.WithMessageFormat("The parameter documentation for '{0}' should be at position {1}");
404404

405405
var expected = diagnostic.WithLocation(8, 22).WithArguments("bar", 2);
406406

StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1130UnitTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace StyleCop.Analyzers.Test.ReadabilityRules
55
{
6+
using System.Diagnostics.CodeAnalysis;
67
using System.Threading;
78
using System.Threading.Tasks;
89
using Microsoft.CodeAnalysis;
@@ -15,9 +16,11 @@ namespace StyleCop.Analyzers.Test.ReadabilityRules
1516

1617
public class SA1130UnitTests
1718
{
19+
[SuppressMessage("MicrosoftCodeAnalysisDesign", "RS1032:Define diagnostic message correctly", Justification = "The message here matches the compiler.")]
1820
private static readonly DiagnosticDescriptor CS1065 =
1921
new DiagnosticDescriptor(nameof(CS1065), "Title", "Default values are not valid in this context.", "Category", DiagnosticSeverity.Error, AnalyzerConstants.EnabledByDefault);
2022

23+
[SuppressMessage("MicrosoftCodeAnalysisDesign", "RS1032:Define diagnostic message correctly", Justification = "The message here matches the compiler.")]
2124
private static readonly DiagnosticDescriptor CS7014 =
2225
new DiagnosticDescriptor(nameof(CS7014), "Title", "Attributes are not valid in this context.", "Category", DiagnosticSeverity.Error, AnalyzerConstants.EnabledByDefault);
2326

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/DocumentationResources.Designer.cs

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/DocumentationResources.resx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@
268268
<value>The documentation describing the parameters to a C# method, constructor, delegate or indexer element does not match the actual parameters on the element.</value>
269269
</data>
270270
<data name="SA1612MissingParamForDocumentationMessageFormat" xml:space="preserve">
271-
<value>The parameter '{0}' does not exist.</value>
271+
<value>The parameter '{0}' does not exist</value>
272272
</data>
273273
<data name="SA1612ParamWrongOrderMessageFormat" xml:space="preserve">
274-
<value>The parameter documentation for '{0}' should be at position {1}.</value>
274+
<value>The parameter documentation for '{0}' should be at position {1}</value>
275275
</data>
276276
<data name="SA1612Title" xml:space="preserve">
277277
<value>Element parameter documentation should match element parameters</value>
@@ -418,7 +418,7 @@
418418
<value>The XML header documentation for a C# code element contains an empty tag.</value>
419419
</data>
420420
<data name="SA1627MessageFormat" xml:space="preserve">
421-
<value>The documentation text within the '{0}' tag should not be empty.</value>
421+
<value>The documentation text within the '{0}' tag should not be empty</value>
422422
</data>
423423
<data name="SA1627Title" xml:space="preserve">
424424
<value>Documentation text should not be empty</value>
@@ -631,7 +631,7 @@
631631
<value>The file name of a C# code file does not match the first type declared in the file.</value>
632632
</data>
633633
<data name="SA1649MessageFormat" xml:space="preserve">
634-
<value>File name should match first type name.</value>
634+
<value>File name should match first type name</value>
635635
</data>
636636
<data name="SA1649Title" xml:space="preserve">
637637
<value>File name should match first type name</value>

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/ReadabilityResources.Designer.cs

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StyleCop.Analyzers/StyleCop.Analyzers/ReadabilityRules/ReadabilityResources.resx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
<value>The opening parenthesis or bracket is not placed on the same line as the method/indexer/attribute/array name.</value>
242242
</data>
243243
<data name="SA1110MessageFormat" xml:space="preserve">
244-
<value>Opening parenthesis or bracket should be on declaration line.</value>
244+
<value>Opening parenthesis or bracket should be on declaration line</value>
245245
</data>
246246
<data name="SA1110Title" xml:space="preserve">
247247
<value>Opening parenthesis or bracket should be on declaration line</value>
@@ -268,7 +268,7 @@
268268
<value>A comma between two parameters in a call to a C# method or indexer, or in the declaration of a method or indexer, is not placed on the same line as the previous parameter.</value>
269269
</data>
270270
<data name="SA1113MessageFormat" xml:space="preserve">
271-
<value>Comma should be on the same line as previous parameter.</value>
271+
<value>Comma should be on the same line as previous parameter</value>
272272
</data>
273273
<data name="SA1113Title" xml:space="preserve">
274274
<value>Comma should be on the same line as previous parameter</value>
@@ -286,7 +286,7 @@
286286
<value>A parameter within a C# method or indexer call or declaration does not begin on the same line as the previous parameter, or on the next line.</value>
287287
</data>
288288
<data name="SA1115MessageFormat" xml:space="preserve">
289-
<value>The parameter should begin on the line after the previous parameter.</value>
289+
<value>The parameter should begin on the line after the previous parameter</value>
290290
</data>
291291
<data name="SA1115Title" xml:space="preserve">
292292
<value>Parameter should follow comma</value>
@@ -307,7 +307,7 @@
307307
<value>The parameters to a C# method or indexer call or declaration are not all on the same line or each on a separate line.</value>
308308
</data>
309309
<data name="SA1117MessageFormat" xml:space="preserve">
310-
<value>The parameters should all be placed on the same line or each parameter should be placed on its own line.</value>
310+
<value>The parameters should all be placed on the same line or each parameter should be placed on its own line</value>
311311
</data>
312312
<data name="SA1117Title" xml:space="preserve">
313313
<value>Parameters should be on same line or separate lines</value>
@@ -361,7 +361,7 @@
361361
<value>The C# code contains a region within the body of a code element.</value>
362362
</data>
363363
<data name="SA1123MessageFormat" xml:space="preserve">
364-
<value>Region should not be located within a code element.</value>
364+
<value>Region should not be located within a code element</value>
365365
</data>
366366
<data name="SA1123Title" xml:space="preserve">
367367
<value>Do not place regions within elements</value>
@@ -472,7 +472,7 @@
472472
<value>Each attribute usage should be placed in its own set of square brackets for maximum readability.</value>
473473
</data>
474474
<data name="SA1133MessageFormat" xml:space="preserve">
475-
<value>Each attribute should be placed in its own set of square brackets.</value>
475+
<value>Each attribute should be placed in its own set of square brackets</value>
476476
</data>
477477
<data name="SA1133Title" xml:space="preserve">
478478
<value>Do not combine attributes</value>
@@ -484,7 +484,7 @@
484484
<value>Each attribute should be placed on its own line of code.</value>
485485
</data>
486486
<data name="SA1134MessageFormat" xml:space="preserve">
487-
<value>Each attribute should be placed on its own line of code.</value>
487+
<value>Each attribute should be placed on its own line of code</value>
488488
</data>
489489
<data name="SA1134Title" xml:space="preserve">
490490
<value>Attributes should not share line</value>

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SpacingResources.Designer.cs

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)