Skip to content

Commit 4cc8c0b

Browse files
committed
Exclude permanently unreachable methods from code coverage
1 parent 67504a0 commit 4cc8c0b

15 files changed

Lines changed: 37 additions & 0 deletions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -49,6 +50,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
4950
}
5051

5152
/// <inheritdoc/>
53+
[ExcludeFromCodeCoverage]
5254
public override void Initialize(AnalysisContext context)
5355
{
5456
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1628DocumentationTextMustBeginWithACapitalLetter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -65,6 +66,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6566
}
6667

6768
/// <inheritdoc/>
69+
[ExcludeFromCodeCoverage]
6870
public override void Initialize(AnalysisContext context)
6971
{
7072
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1630DocumentationTextMustContainWhitespace.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -65,6 +66,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6566
}
6667

6768
/// <inheritdoc/>
69+
[ExcludeFromCodeCoverage]
6870
public override void Initialize(AnalysisContext context)
6971
{
7072
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1631DocumentationMustMeetCharacterPercentage.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -66,6 +67,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6667
}
6768

6869
/// <inheritdoc/>
70+
[ExcludeFromCodeCoverage]
6971
public override void Initialize(AnalysisContext context)
7072
{
7173
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1632DocumentationTextMustMeetMinimumCharacterLength.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -64,6 +65,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6465
}
6566

6667
/// <inheritdoc/>
68+
[ExcludeFromCodeCoverage]
6769
public override void Initialize(AnalysisContext context)
6870
{
6971
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1645IncludedDocumentationFileDoesNotExist.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -61,6 +62,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6162
}
6263

6364
/// <inheritdoc/>
65+
[ExcludeFromCodeCoverage]
6466
public override void Initialize(AnalysisContext context)
6567
{
6668
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1646IncludedDocumentationXPathDoesNotExist.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -62,6 +63,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6263
}
6364

6465
/// <inheritdoc/>
66+
[ExcludeFromCodeCoverage]
6567
public override void Initialize(AnalysisContext context)
6668
{
6769
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1647IncludeNodeDoesNotContainValidFileAndPath.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -63,6 +64,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
6364
}
6465

6566
/// <inheritdoc/>
67+
[ExcludeFromCodeCoverage]
6668
public override void Initialize(AnalysisContext context)
6769
{
6870
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1650ElementDocumentationMustBeSpelledCorrectly.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace StyleCop.Analyzers.DocumentationRules
55
{
66
using System.Collections.Immutable;
7+
using System.Diagnostics.CodeAnalysis;
78
using Microsoft.CodeAnalysis;
89
using Microsoft.CodeAnalysis.Diagnostics;
910

@@ -81,6 +82,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
8182
}
8283

8384
/// <inheritdoc/>
85+
[ExcludeFromCodeCoverage]
8486
public override void Initialize(AnalysisContext context)
8587
{
8688
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace System.Diagnostics.CodeAnalysis
5+
{
6+
[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
7+
internal sealed class ExcludeFromCodeCoverageAttribute : Attribute
8+
{
9+
}
10+
}

0 commit comments

Comments
 (0)