Skip to content

Commit 31d1955

Browse files
authored
Merge pull request #2866 from sharwell/disable-sa1644
Permanently disable SA1644 (Documentation headers should not contain blank lines)
2 parents 7ddb79b + 098f8fa commit 31d1955

5 files changed

Lines changed: 41 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 StyleCop.Analyzers.Test.CSharp7.DocumentationRules
5+
{
6+
using StyleCop.Analyzers.Test.DocumentationRules;
7+
8+
public class SA1644CSharp7UnitTests : SA1644UnitTests
9+
{
10+
}
11+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 StyleCop.Analyzers.Test.DocumentationRules
5+
{
6+
using Microsoft.CodeAnalysis;
7+
using StyleCop.Analyzers.DocumentationRules;
8+
using Xunit;
9+
10+
/// <summary>
11+
/// This class contains unit tests for <see cref="SA1644DocumentationHeadersMustNotContainBlankLines"/>.
12+
/// </summary>
13+
public class SA1644UnitTests
14+
{
15+
[Fact]
16+
public void TestDisabledByDefaultAndNotConfigurable()
17+
{
18+
var analyzer = new SA1644DocumentationHeadersMustNotContainBlankLines();
19+
Assert.Single(analyzer.SupportedDiagnostics);
20+
Assert.False(analyzer.SupportedDiagnostics[0].IsEnabledByDefault);
21+
Assert.Contains(WellKnownDiagnosticTags.NotConfigurable, analyzer.SupportedDiagnostics[0].CustomTags);
22+
}
23+
}
24+
}

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1644DocumentationHeadersMustNotContainBlankLines.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal class SA1644DocumentationHeadersMustNotContainBlankLines : DiagnosticAn
6666
private const string HelpLink = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1644.md";
6767

6868
private static readonly DiagnosticDescriptor Descriptor =
69-
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledNoTests, Description, HelpLink, WellKnownDiagnosticTags.NotConfigurable);
69+
new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, AnalyzerCategory.DocumentationRules, DiagnosticSeverity.Warning, AnalyzerConstants.DisabledByDefault, Description, HelpLink, WellKnownDiagnosticTags.NotConfigurable);
7070

7171
/// <inheritdoc/>
7272
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
@@ -75,7 +75,7 @@ internal class SA1644DocumentationHeadersMustNotContainBlankLines : DiagnosticAn
7575
/// <inheritdoc/>
7676
public override void Initialize(AnalysisContext context)
7777
{
78-
// TODO: Implement analysis
78+
// This diagnostic is not implemented (by design) in StyleCopAnalyzers.
7979
}
8080
}
8181
}

documentation/KnownChanges.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ lists each of these issues, along with a link to the issue where the decision wa
3333
| SA1630 | Documentation text should contain whitespace | [#1057](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1057) |
3434
| SA1631 | Documentation should meet character percentage | [#1057](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1057) |
3535
| SA1632 | Documentation text should meet minimum character length | [#1057](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1057) |
36+
| SA1644 | DocumentationHeadersMustNotContainBlankLines | [#164](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/164) |
3637
| SA1645 | Included documentation file does not exist | [#165](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/165) |
3738
| SA1646 | Included documentation XPath does not exist | [#166](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/166) |
3839
| SA1647 | Include node does not contain valid file and path | [#167](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/167) |

documentation/SA1644.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
</tr>
1616
</table>
1717

18+
:warning: This rule has been intentionally omitted from StyleCop Analyzers. See [KnownChanges.md](KnownChanges.md) for
19+
additional information.
20+
1821
## Cause
1922

2023
A section within the Xml documentation header for a C# element contains blank lines.

0 commit comments

Comments
 (0)