Skip to content

Commit 855ab0a

Browse files
committed
Merge pull request #1724 from vweijsters/fix-1692
Enabled SA1627 by default, moved text strings to resources.
2 parents 99fd634 + 8c60f62 commit 855ab0a

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
@@ -141,6 +141,15 @@
141141
<data name="SA1626CodeFix" xml:space="preserve">
142142
<value>Convert to line comment</value>
143143
</data>
144+
<data name="SA1627Description" xml:space="preserve">
145+
<value>The XML header documentation for a C# code element contains an empty tag.</value>
146+
</data>
147+
<data name="SA1627MessageFormat" xml:space="preserve">
148+
<value>The documentation text within the \'{0}\' tag must not be empty.</value>
149+
</data>
150+
<data name="SA1627Title" xml:space="preserve">
151+
<value>Documentation text must not be empty</value>
152+
</data>
144153
<data name="SA1633CodeFix" xml:space="preserve">
145154
<value>Add file header</value>
146155
</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)