Skip to content

Commit 05f7b62

Browse files
authored
Removed unnecessary suppressions (#8401)
1 parent 4de77ab commit 05f7b62

File tree

27 files changed

+7
-63
lines changed

27 files changed

+7
-63
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ dotnet_diagnostic.IDE0055.severity = warning
212212
dotnet_diagnostic.IDE0057.severity = warning
213213
# Use compound assignment.
214214
dotnet_diagnostic.IDE0074.severity = warning
215+
# Remove unnecessary suppression.
216+
dotnet_diagnostic.IDE0079.severity = warning
217+
# See https://github.com/dotnet/roslyn/issues/75887
218+
dotnet_remove_unnecessary_suppression_exclusions = CA1822, InconsistentNaming, RCS1102, xUnit1044
215219
# Use pattern matching (not operator).
216220
dotnet_diagnostic.IDE0083.severity = warning
217221
# Use collection expression for array.

src/GreenDonut/src/GreenDonut/Result.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,4 @@ public static implicit operator TValue(Result<TValue> result)
108108
=> result.Value;
109109
}
110110

111-
#pragma warning disable RCS1194
112111
public class KeyNotFoundException(string message) : Exception(message);
113-
#pragma warning restore RCS1194

src/HotChocolate/Core/src/Types.Analyzers/GraphQLServerGenerator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
namespace HotChocolate.Types.Analyzers;
1313

14-
#pragma warning disable RS1041
1514
[Generator]
16-
#pragma warning restore RS1041
1715
public class GraphQLServerGenerator : IIncrementalGenerator
1816
{
1917
private static readonly ISyntaxInspector[] s_allInspectors =

src/HotChocolate/Core/src/Types.Shared/WellKnownTypes.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
using System.Diagnostics.CodeAnalysis;
2-
31
namespace HotChocolate.Utilities.Introspection;
42

5-
[SuppressMessage("ReSharper", "InconsistentNaming")]
63
internal static class WellKnownTypes
74
{
8-
#pragma warning disable IDE1006 // Naming Styles
5+
#pragma warning disable IDE1006, InconsistentNaming
96
public const string __Directive = "__Directive";
107
public const string __DirectiveLocation = "__DirectiveLocation";
118
public const string __EnumValue = "__EnumValue";
@@ -14,7 +11,7 @@ internal static class WellKnownTypes
1411
public const string __Schema = "__Schema";
1512
public const string __Type = "__Type";
1613
public const string __TypeKind = "__TypeKind";
17-
#pragma warning restore IDE1006 // Naming Styles
14+
#pragma warning restore IDE1006, InconsistentNaming
1815
public const string String = "String";
1916
public const string Boolean = "Boolean";
2017
public const string Float = "Float";

src/HotChocolate/Core/src/Types/InvalidSchemaCoordinateException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ namespace HotChocolate;
77
/// <see cref="Coordinate"/>
88
/// could not be resolved.
99
/// </summary>
10-
#pragma warning disable RCS1194
1110
public class InvalidSchemaCoordinateException : Exception
1211
{
1312
/// <summary>
@@ -27,4 +26,3 @@ public InvalidSchemaCoordinateException(string message, SchemaCoordinate coordin
2726
/// <value></value>
2827
public SchemaCoordinate Coordinate { get; }
2928
}
30-
#pragma warning restore RCS1194

src/HotChocolate/Core/src/Types/SchemaException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace HotChocolate;
77

8-
#pragma warning disable RCS1194
98
public sealed class SchemaException : Exception
109
{
1110
public SchemaException(params ISchemaError[] errors)
@@ -53,4 +52,3 @@ private static string CreateErrorMessage(IReadOnlyList<ISchemaError> errors)
5352
return message.ToString();
5453
}
5554
}
56-
#pragma warning restore RCS1194

src/HotChocolate/Core/src/Types/Types/Relay/IdSerializationException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace HotChocolate.Types.Relay;
44

5-
#pragma warning disable RCS1194
65
public class IdSerializationException
76
: GraphQLException
87
{
@@ -18,4 +17,3 @@ public IdSerializationException(
1817
{
1918
}
2019
}
21-
#pragma warning restore RCS1194
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#nullable enable
22
namespace HotChocolate.Types.Relay;
33

4-
#pragma warning disable RCS1194
54
public sealed class NodeIdInvalidFormatException(object originalValue)
65
: GraphQLException(ErrorBuilder.New()
76
.SetMessage("The node ID string has an invalid format.")
87
.SetExtension(nameof(originalValue), originalValue.ToString())
98
.Build());
10-
#pragma warning restore RCS1194
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#nullable enable
22
namespace HotChocolate.Types.Relay;
33

4-
#pragma warning disable RCS1194
54
public sealed class NodeIdMissingSerializerException(string typeName)
65
: GraphQLException(ErrorBuilder.New()
76
.SetMessage("No serializer registered for type `{0}`.", typeName)
87
.SetExtension(nameof(typeName), typeName)
98
.Build());
10-
#pragma warning restore RCS1194

src/HotChocolate/Core/test/Execution.Tests/Errors/ErrorBehaviorTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Diagnostics.CodeAnalysis;
21
using HotChocolate.Types;
32
using Microsoft.Extensions.DependencyInjection;
43
using static HotChocolate.Execution.SnapshotHelpers;
@@ -201,7 +200,6 @@ protected override void Configure(
201200
}
202201
}
203202

204-
[SuppressMessage("ReSharper", "UnusedMember.Global")]
205203
public class Query
206204
{
207205
public Task<string?> Error1()
@@ -275,13 +273,11 @@ public class Query
275273
public string Error15 => throw new ArgumentNullException("Error15");
276274
}
277275

278-
[SuppressMessage("ReSharper", "UnusedMember.Global")]
279276
public class Foo
280277
{
281278
public string? Bar => throw new Exception("baz");
282279
}
283280

284-
[SuppressMessage("ReSharper", "UnusedMember.Global")]
285281
public class Baz
286282
{
287283
public string? Bar => throw new Exception("baz");

0 commit comments

Comments
 (0)