Skip to content

Commit 7a38278

Browse files
committed
Remove unneeded warning suppressions
1 parent 086992e commit 7a38278

23 files changed

+1
-101
lines changed

src/StreamJsonRpc/AwaitExtensions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ internal static SynchronizationContextAwaiter GetAwaiter(this SynchronizationCon
2323
return new SynchronizationContextAwaiter(synchronizationContext);
2424
}
2525

26-
#pragma warning disable CA1822 // Mark members as static
27-
2826
/// <summary>
2927
/// The awaiter for <see cref="SynchronizationContext"/>.
3028
/// </summary>
@@ -74,5 +72,4 @@ public void OnCompleted(Action continuation)
7472
#pragma warning restore VSTHRD001 // Avoid legacy threading switching APIs
7573
}
7674
}
77-
#pragma warning restore CA1822 // Mark members as static
7875
}

src/StreamJsonRpc/CommonMethodNameTransforms.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ public static Func<string, string> CamelCase
2020
{
2121
if (name is null)
2222
{
23-
#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations
2423
throw new ArgumentNullException();
25-
#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations
2624
}
2725

2826
return Utilities.ToCamelCase(name);

src/StreamJsonRpc/Exceptions/BadRpcHeaderException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ namespace StreamJsonRpc;
88
/// </summary>
99
/// <seealso cref="RemoteRpcException" />
1010
[Serializable]
11-
#pragma warning disable CA1032 // Implement standard exception constructors
1211
public class BadRpcHeaderException : RemoteRpcException
13-
#pragma warning restore CA1032 // Implement standard exception constructors
1412
{
1513
/// <summary>
1614
/// Initializes a new instance of the <see cref="BadRpcHeaderException"/> class.

src/StreamJsonRpc/Exceptions/RemoteInvocationException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ namespace StreamJsonRpc;
1414
/// The details of the target method exception can be found on the <see cref="ErrorCode"/> and <see cref="ErrorData"/> properties.
1515
/// </remarks>
1616
[Serializable]
17-
#pragma warning disable CA1032 // Implement standard exception constructors
1817
public class RemoteInvocationException : RemoteRpcException
19-
#pragma warning restore CA1032 // Implement standard exception constructors
2018
{
2119
/// <summary>
2220
/// Initializes a new instance of the <see cref="RemoteInvocationException"/> class.

src/StreamJsonRpc/Exceptions/RemoteMethodNotFoundException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ namespace StreamJsonRpc;
1515
/// its arguments were incompatible with the arguments supplied by the client.
1616
/// </remarks>
1717
[Serializable]
18-
#pragma warning disable CA1032 // Implement standard exception constructors
1918
public class RemoteMethodNotFoundException : RemoteRpcException
20-
#pragma warning restore CA1032 // Implement standard exception constructors
2119
{
2220
/// <summary>
2321
/// Initializes a new instance of the <see cref="RemoteMethodNotFoundException"/> class

src/StreamJsonRpc/Exceptions/RemoteRpcException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ namespace StreamJsonRpc;
1111
/// Base exception class for any exception that happens while receiving an JSON-RPC communication.
1212
/// </summary>
1313
[System.Serializable]
14-
#pragma warning disable CA1032 // Implement standard exception constructors
1514
public abstract class RemoteRpcException : Exception
16-
#pragma warning restore CA1032 // Implement standard exception constructors
1715
{
1816
/// <summary>
1917
/// Initializes a new instance of the <see cref="RemoteRpcException"/> class.

src/StreamJsonRpc/Exceptions/RemoteSerializationException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace StreamJsonRpc;
1212
/// This exception comes from the <see cref="JsonRpcErrorCode.ResponseSerializationFailure"/> error code.
1313
/// </remarks>
1414
[Serializable]
15-
#pragma warning disable CA1032 // Implement standard exception constructors
1615
public class RemoteSerializationException : RemoteRpcException
17-
#pragma warning restore CA1032 // Implement standard exception constructors
1816
{
1917
/// <summary>
2018
/// Initializes a new instance of the <see cref="RemoteSerializationException"/> class.

src/StreamJsonRpc/Exceptions/RpcArgumentDeserializationException.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace StreamJsonRpc;
1212
/// when the argument cannot be deserialized to the requested type, typically due to an incompatibility or exception thrown from the deserializer.
1313
/// </summary>
1414
[Serializable]
15-
#pragma warning disable CA1032 // Implement standard exception constructors
1615
public class RpcArgumentDeserializationException : RemoteRpcException
17-
#pragma warning restore CA1032 // Implement standard exception constructors
1816
{
1917
/// <summary>
2018
/// Initializes a new instance of the <see cref="RpcArgumentDeserializationException"/> class.

src/StreamJsonRpc/Exceptions/UnexpectedEmptyEnumerableResponseException.cs

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

44
namespace StreamJsonRpc;
55

6-
#pragma warning disable CA1032 // Implement standard exception constructors
76
internal class UnexpectedEmptyEnumerableResponseException : RemoteRpcException
8-
#pragma warning restore CA1032 // Implement standard exception constructors
97
{
108
/// <summary>
119
/// Initializes a new instance of the <see cref="UnexpectedEmptyEnumerableResponseException"/> class.

src/StreamJsonRpc/HeaderDelimitedMessageHandler.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ public HeaderDelimitedMessageHandler(Stream duplexStream)
108108
/// <param name="sendingStream">The stream to use for transmitting messages.</param>
109109
/// <param name="receivingStream">The stream to use for receiving messages.</param>
110110
public HeaderDelimitedMessageHandler(Stream? sendingStream, Stream? receivingStream)
111-
#pragma warning disable CA2000 // Dispose objects before losing scope
112111
: this(sendingStream, receivingStream, new JsonMessageFormatter())
113-
#pragma warning restore CA2000 // Dispose objects before losing scope
114112
{
115113
}
116114

0 commit comments

Comments
 (0)