Skip to content

Commit f05e541

Browse files
Handle comments from PR #3800 and #3801
1 parent f66d17d commit f05e541

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1612UnitTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,13 @@ public class ClassName
536536
}
537537

538538
private static Task VerifyCSharpDiagnosticAsync(string source, DiagnosticResult expected, CancellationToken cancellationToken)
539-
=> VerifyCSharpDiagnosticAsync(source, testSettings: null, new[] { expected }, false, cancellationToken);
539+
=> VerifyCSharpDiagnosticAsync(source, testSettings: null, new[] { expected }, ignoreCompilerDiagnostics: false, cancellationToken);
540540

541541
private static Task VerifyCSharpDiagnosticAsync(string source, DiagnosticResult[] expected, CancellationToken cancellationToken)
542-
=> VerifyCSharpDiagnosticAsync(source, testSettings: null, expected, false, cancellationToken);
542+
=> VerifyCSharpDiagnosticAsync(source, testSettings: null, expected, ignoreCompilerDiagnostics: false, cancellationToken);
543543

544544
private static Task VerifyCSharpDiagnosticAsync(string source, string testSettings, DiagnosticResult[] expected, CancellationToken cancellationToken)
545-
=> VerifyCSharpDiagnosticAsync(source, testSettings, expected, false, cancellationToken);
545+
=> VerifyCSharpDiagnosticAsync(source, testSettings, expected, ignoreCompilerDiagnostics: false, cancellationToken);
546546

547547
private static Task VerifyCSharpDiagnosticAsync(string source, string testSettings, DiagnosticResult[] expected, bool ignoreCompilerDiagnostics, CancellationToken cancellationToken)
548548
{

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/CommonMemberData.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
#nullable disable
5-
64
namespace StyleCop.Analyzers.Test.Helpers
75
{
86
using System.Collections.Generic;
@@ -115,7 +113,7 @@ public static IEnumerable<object[]> GenericTypeDeclarationKeywords
115113
}
116114
}
117115

118-
public static IEnumerable<object[]> TypeKeywordsWhichSupportPrimaryConstructors
116+
public static IEnumerable<object[]> ReferenceTypeKeywordsWhichSupportPrimaryConstructors
119117
{
120118
get
121119
{
@@ -127,22 +125,33 @@ public static IEnumerable<object[]> TypeKeywordsWhichSupportPrimaryConstructors
127125
if (LightupHelpers.SupportsCSharp10)
128126
{
129127
yield return new[] { "record class" };
130-
yield return new[] { "record struct" };
131128
}
132129

133130
if (LightupHelpers.SupportsCSharp12)
134131
{
135132
yield return new[] { "class" };
136-
yield return new[] { "struct" };
137133
}
138134
}
139135
}
140136

141-
public static IEnumerable<object[]> ReferenceTypeKeywordsWhichSupportPrimaryConstructors
137+
public static IEnumerable<object[]> TypeKeywordsWhichSupportPrimaryConstructors
142138
{
143139
get
144140
{
145-
return TypeKeywordsWhichSupportPrimaryConstructors.Where(x => !((string)x[0]).Contains("struct"));
141+
foreach (var keyword in ReferenceTypeKeywordsWhichSupportPrimaryConstructors)
142+
{
143+
yield return keyword;
144+
}
145+
146+
if (LightupHelpers.SupportsCSharp10)
147+
{
148+
yield return new[] { "record struct" };
149+
}
150+
151+
if (LightupHelpers.SupportsCSharp12)
152+
{
153+
yield return new[] { "struct" };
154+
}
146155
}
147156
}
148157
}

0 commit comments

Comments
 (0)