Skip to content

Commit 8c653af

Browse files
authored
Merge pull request #1016 from AArnott/cleanup
Code cleanup
2 parents 336ee89 + abe791f commit 8c653af

26 files changed

+4
-900
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
4646
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
4747
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
48+
<GlobalPackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator" Version="3.11.0-beta1.24122.1" />
4849
<GlobalPackageReference Include="Microsoft.VisualStudio.Internal.MicroBuild.VisualStudio" Version="$(MicroBuildVersion)" />
4950
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
5051
<GlobalPackageReference Include="Nullable" Version="1.3.1" />

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.

0 commit comments

Comments
 (0)