Skip to content

Commit 8c60f62

Browse files
committed
Enabled SA1627 by default, moved text strings to resources.
1 parent fbc39b3 commit 8c60f62

3 files changed

Lines changed: 41 additions & 5 deletions

File tree

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

Lines changed: 27 additions & 0 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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@
132132
<data name="SA1626CodeFix" xml:space="preserve">
133133
<value>Convert to line comment</value>
134134
</data>
135+
<data name="SA1627Description" xml:space="preserve">
136+
<value>The XML header documentation for a C# code element contains an empty tag.</value>
137+
</data>
138+
<data name="SA1627MessageFormat" xml:space="preserve">
139+
<value>The documentation text within the \'{0}\' tag must not be empty.</value>
140+
</data>
141+
<data name="SA1627Title" xml:space="preserve">
142+
<value>Documentation text must not be empty</value>
143+
</data>
135144
<data name="SA1633CodeFix" xml:space="preserve">
136145
<value>Add file header</value>
137146
</data>

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1627DocumentationTextMustNotBeEmpty.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ internal class SA1627DocumentationTextMustNotBeEmpty : DiagnosticAnalyzer
4747
/// The ID for diagnostics produced by the <see cref="SA1627DocumentationTextMustNotBeEmpty"/> analyzer.
4848
/// </summary>
4949
public const string DiagnosticId = "SA1627";
50-
private const string Title = "Documentation text must not be empty";
51-
private const string MessageFormat = "The documentation text within the \'{0}\' tag must not be empty.";
52-
private const string Description = "The XML header documentation for a C# code element contains an empty tag.";
53-
private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1627.md";
50+
private static readonly LocalizableString Title = new LocalizableResourceString(nameof(DocumentationResources.SA1627Title), DocumentationResources.ResourceManager, typeof(DocumentationResources));
51+
private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(DocumentationResources.SA1627MessageFormat), DocumentationResources.ResourceManager, typeof(DocumentationResources));
52+
private static readonly LocalizableString Description = new LocalizableResourceString(nameof(DocumentationResources.SA1627Description), DocumentationResources.ResourceManager, typeof(DocumentationResources));
53+
private static readonly string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1627.md";
5454

5555
private static readonly DiagnosticDescriptor Descriptor =
56-
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledNoTests, Description, HelpLink);
56+
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
5757

5858
private static readonly Action<CompilationStartAnalysisContext> CompilationStartAction = HandleCompilationStart;
5959
private static readonly Action<SyntaxNodeAnalysisContext> XmlElementAction = HandleXmlElement;

0 commit comments

Comments
 (0)