Skip to content

Commit 1cf7fb8

Browse files
committed
Suppress RS1005 false positives
See dotnet/roslyn-analyzers#4103
1 parent f527ee4 commit 1cf7fb8

8 files changed

Lines changed: 28 additions & 0 deletions

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/SA1612ElementParameterDocumentationMustMatchElementParameters.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ protected override void HandleXmlElement(SyntaxNodeAnalysisContext context, Styl
109109

110110
if (parentParameters.Length <= index || parentParameters[index] != parentParameter)
111111
{
112+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
112113
context.ReportDiagnostic(
113114
Diagnostic.Create(
114115
OrderDescriptor,
115116
location,
116117
nameAttributeText,
117118
parentParameters.IndexOf(parentParameter) + 1));
119+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
118120
}
119121
}
120122

@@ -180,12 +182,14 @@ protected override void HandleCompleteDocumentation(SyntaxNodeAnalysisContext co
180182

181183
if (parentParameters.Length <= index || parentParameters[index] != parentParameter)
182184
{
185+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
183186
context.ReportDiagnostic(
184187
Diagnostic.Create(
185188
OrderDescriptor,
186189
identifierLocation,
187190
nameAttributeText,
188191
parentParameters.IndexOf(parentParameter) + 1));
192+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
189193
}
190194
}
191195

StyleCop.Analyzers/StyleCop.Analyzers/OrderingRules/SA1200UsingDirectivesMustBePlacedCorrectly.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ private static void HandleNamespaceDeclaration(SyntaxNodeAnalysisContext context
261261
foreach (UsingDirectiveSyntax directive in syntax.Usings)
262262
{
263263
// Using directive should appear outside a namespace declaration
264+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
264265
context.ReportDiagnostic(Diagnostic.Create(DescriptorOutside, directive.GetLocation()));
266+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
265267
}
266268
}
267269
}

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1009ClosingParenthesisMustBeSpacedCorrectly.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,17 @@ private static void HandleCloseParenToken(SyntaxTreeAnalysisContext context, Syn
244244
{
245245
// Closing parenthesis should{} be {followed} by a space.
246246
var properties = TokenSpacingProperties.InsertFollowing;
247+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
247248
context.ReportDiagnostic(Diagnostic.Create(DescriptorFollowed, token.GetLocation(), properties));
249+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
248250
}
249251
else if (precedesStickyCharacter && followedBySpace && (!lastInLine || !allowEndOfLine))
250252
{
251253
// Closing parenthesis should{ not} be {followed} by a space.
252254
var properties = TokenSpacingProperties.RemoveFollowing;
255+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
253256
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotFollowed, token.GetLocation(), properties));
257+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
254258
}
255259
}
256260
}

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1010OpeningSquareBracketsMustBeSpacedCorrectly.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ private static void HandleOpenBracketToken(SyntaxTreeAnalysisContext context, Sy
108108
if (!lastInLine && followedBySpace)
109109
{
110110
// Opening square bracket should {not be followed} by a space.
111+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
111112
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotFollowed, token.GetLocation(), TokenSpacingProperties.RemoveFollowing));
113+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
112114
}
113115
}
114116

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1015ClosingGenericBracketsMustBeSpacedCorrectly.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,17 @@ private static void HandleGreaterThanToken(SyntaxTreeAnalysisContext context, Sy
156156
{
157157
// Closing generic bracket should{} be {followed} by a space.
158158
var properties = TokenSpacingProperties.InsertFollowing;
159+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
159160
context.ReportDiagnostic(Diagnostic.Create(DescriptorFollowed, token.GetLocation(), properties));
161+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
160162
}
161163
else if (!allowTrailingSpace && followedBySpace)
162164
{
163165
// Closing generic bracket should{ not} be {followed} by a space.
164166
var properties = TokenSpacingProperties.RemoveFollowing;
167+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
165168
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotFollowed, token.GetLocation(), properties));
169+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
166170
}
167171
}
168172
}

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1019MemberAccessSymbolsMustBeSpacedCorrectly.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ private static void HandleMemberAccessSymbol(SyntaxTreeAnalysisContext context,
123123
{
124124
// Member access symbol '{.}' should not be {followed} by a space.
125125
var properties = TokenSpacingProperties.RemoveFollowing;
126+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
126127
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotFollowed, token.GetLocation(), properties, token.Text));
128+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
127129
}
128130
}
129131
}

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1023DereferenceAndAccessOfSymbolsMustBeSpacedCorrectly.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ private static void HandleAsteriskToken(SyntaxTreeAnalysisContext context, Synta
166166
{
167167
// Dereference symbol '*' should {not appear at the beginning of a line}.
168168
var properties = TokenSpacingProperties.RemovePreceding;
169+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
169170
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotAtBeginningOfLine, token.GetLocation(), properties));
171+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
170172
}
171173
else if (!allowPrecedingSpace && precededBySpace)
172174
{
@@ -179,20 +181,26 @@ private static void HandleAsteriskToken(SyntaxTreeAnalysisContext context, Synta
179181
{
180182
// Dereference symbol '*' should {not appear at the end of a line}.
181183
var properties = TokenSpacingProperties.RemoveFollowing;
184+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
182185
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotAtEndOfLine, token.GetLocation(), properties));
186+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
183187
}
184188
else if (!allowTrailingSpace && followedBySpace)
185189
{
186190
// Dereference symbol '*' should {not be followed by a space}.
187191
var properties = TokenSpacingProperties.RemoveFollowing;
192+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
188193
context.ReportDiagnostic(Diagnostic.Create(DescriptorNotFollowed, token.GetLocation(), properties));
194+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
189195
}
190196

191197
if (!followedBySpace && allowTrailingSpace)
192198
{
193199
// Dereference symbol '*' should {be followed by a space}.
194200
var properties = TokenSpacingProperties.InsertFollowing;
201+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
195202
context.ReportDiagnostic(Diagnostic.Create(DescriptorFollowed, token.GetLocation(), properties));
203+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
196204
}
197205
}
198206
}

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1024ColonsMustBeSpacedCorrectly.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ private static void HandleColonToken(SyntaxTreeAnalysisContext context, SyntaxTo
183183
if (missingFollowingSpace && checkRequireAfter)
184184
{
185185
// colon should{} be {followed}{} by a space
186+
#pragma warning disable RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor (https://github.com/dotnet/roslyn-analyzers/issues/4103)
186187
context.ReportDiagnostic(Diagnostic.Create(DescriptorFollowed, token.GetLocation(), TokenSpacingProperties.InsertFollowing));
188+
#pragma warning restore RS1005 // ReportDiagnostic invoked with an unsupported DiagnosticDescriptor
187189
}
188190
}
189191
}

0 commit comments

Comments
 (0)