Skip to content

Commit 3938c68

Browse files
committed
Merge pull request #1656 from vweijsters/cleanup-supporteddiagnostics
Refactor: cleanup SupportedDiagnostics declarations
2 parents ac225c9 + ba124c1 commit 3938c68

169 files changed

Lines changed: 343 additions & 1554 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/ExclusionTestAnalyzer.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,9 @@ internal class ExclusionTestAnalyzer : DiagnosticAnalyzer
2525
private static readonly DiagnosticDescriptor Descriptor =
2626
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, "TestRules", DiagnosticSeverity.Warning, true, Description, HelpLink);
2727

28-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
29-
ImmutableArray.Create(Descriptor);
30-
3128
/// <inheritdoc/>
32-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
33-
{
34-
get
35-
{
36-
return SupportedDiagnosticsValue;
37-
}
38-
}
29+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
30+
ImmutableArray.Create(Descriptor);
3931

4032
/// <inheritdoc/>
4133
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1600ElementsMustBeDocumented.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,9 @@ internal class SA1600ElementsMustBeDocumented : DiagnosticAnalyzer
4040
private static readonly DiagnosticDescriptor Descriptor =
4141
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
4242

43-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
44-
ImmutableArray.Create(Descriptor);
45-
4643
/// <inheritdoc/>
47-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
48-
{
49-
get
50-
{
51-
return SupportedDiagnosticsValue;
52-
}
53-
}
44+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
45+
ImmutableArray.Create(Descriptor);
5446

5547
/// <inheritdoc/>
5648
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1601PartialElementsMustBeDocumented.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,9 @@ internal class SA1601PartialElementsMustBeDocumented : DiagnosticAnalyzer
8181
private static readonly DiagnosticDescriptor Descriptor =
8282
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
8383

84-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
85-
ImmutableArray.Create(Descriptor);
86-
8784
/// <inheritdoc/>
88-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
89-
{
90-
get
91-
{
92-
return SupportedDiagnosticsValue;
93-
}
94-
}
85+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
86+
ImmutableArray.Create(Descriptor);
9587

9688
/// <inheritdoc/>
9789
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1602EnumerationItemsMustBeDocumented.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,9 @@ internal class SA1602EnumerationItemsMustBeDocumented : DiagnosticAnalyzer
5151
private static readonly DiagnosticDescriptor Descriptor =
5252
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
5353

54-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
55-
ImmutableArray.Create(Descriptor);
56-
5754
/// <inheritdoc/>
58-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
59-
{
60-
get
61-
{
62-
return SupportedDiagnosticsValue;
63-
}
64-
}
55+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
56+
ImmutableArray.Create(Descriptor);
6557

6658
/// <inheritdoc/>
6759
public override void Initialize(AnalysisContext context)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1603DocumentationMustContainValidXml.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,9 @@ internal class SA1603DocumentationMustContainValidXml : DiagnosticAnalyzer
3737
private static readonly DiagnosticDescriptor Descriptor =
3838
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledByDefault, Description, HelpLink, WellKnownDiagnosticTags.NotConfigurable);
3939

40-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
41-
ImmutableArray.Create(Descriptor);
42-
4340
/// <inheritdoc/>
44-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
45-
{
46-
get
47-
{
48-
return SupportedDiagnosticsValue;
49-
}
50-
}
41+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
42+
ImmutableArray.Create(Descriptor);
5143

5244
/// <inheritdoc/>
5345
[ExcludeFromCodeCoverage]

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1604ElementDocumentationMustHaveSummary.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,9 @@ internal class SA1604ElementDocumentationMustHaveSummary : ElementDocumentationS
3535
private static readonly DiagnosticDescriptor Descriptor =
3636
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
3737

38-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
39-
ImmutableArray.Create(Descriptor);
40-
4138
/// <inheritdoc/>
42-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
43-
{
44-
get
45-
{
46-
return SupportedDiagnosticsValue;
47-
}
48-
}
39+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
40+
ImmutableArray.Create(Descriptor);
4941

5042
/// <inheritdoc/>
5143
protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, XmlNodeSyntax syntax, Location[] diagnosticLocations)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1605PartialElementDocumentationMustHaveSummary.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,9 @@ internal class SA1605PartialElementDocumentationMustHaveSummary : PartialElement
8383
private static readonly DiagnosticDescriptor Descriptor =
8484
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
8585

86-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
87-
ImmutableArray.Create(Descriptor);
88-
8986
/// <inheritdoc/>
90-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
91-
{
92-
get
93-
{
94-
return SupportedDiagnosticsValue;
95-
}
96-
}
87+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
88+
ImmutableArray.Create(Descriptor);
9789

9890
/// <inheritdoc/>
9991
protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, XmlNodeSyntax syntax, Location[] diagnosticLocations)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1606ElementDocumentationMustHaveSummaryText.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,9 @@ internal class SA1606ElementDocumentationMustHaveSummaryText : ElementDocumentat
3838
private static readonly DiagnosticDescriptor Descriptor =
3939
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
4040

41-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
42-
ImmutableArray.Create(Descriptor);
43-
4441
/// <inheritdoc/>
45-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
46-
{
47-
get
48-
{
49-
return SupportedDiagnosticsValue;
50-
}
51-
}
42+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
43+
ImmutableArray.Create(Descriptor);
5244

5345
/// <inheritdoc/>
5446
protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, XmlNodeSyntax syntax, Location[] diagnosticLocations)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1607PartialElementDocumentationMustHaveSummaryText.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,9 @@ internal class SA1607PartialElementDocumentationMustHaveSummaryText : PartialEle
8282
private static readonly DiagnosticDescriptor Descriptor =
8383
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
8484

85-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
86-
ImmutableArray.Create(Descriptor);
87-
8885
/// <inheritdoc/>
89-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
90-
{
91-
get
92-
{
93-
return SupportedDiagnosticsValue;
94-
}
95-
}
86+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
87+
ImmutableArray.Create(Descriptor);
9688

9789
/// <inheritdoc/>
9890
protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, XmlNodeSyntax syntax, Location[] diagnosticLocations)

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1608ElementDocumentationMustNotHaveDefaultSummary.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,9 @@ internal class SA1608ElementDocumentationMustNotHaveDefaultSummary : DiagnosticA
4747
private static readonly DiagnosticDescriptor Descriptor =
4848
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.EnabledByDefault, Description, HelpLink);
4949

50-
private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
51-
ImmutableArray.Create(Descriptor);
52-
5350
/// <inheritdoc/>
54-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
55-
{
56-
get
57-
{
58-
return SupportedDiagnosticsValue;
59-
}
60-
}
51+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
52+
ImmutableArray.Create(Descriptor);
6153

6254
/// <inheritdoc/>
6355
public override void Initialize(AnalysisContext context)

0 commit comments

Comments
 (0)