Skip to content

Commit

Permalink
Enable MA0040 and silence remaining case
Browse files Browse the repository at this point in the history
"Flow the cancellation token"
  • Loading branch information
YoshiRulz committed Jul 3, 2024
1 parent a7e1c8f commit b818f53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .global.editorconfig.ini
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ dotnet_diagnostic.MA0038.severity = silent
# Do not write your own certificate validation method
dotnet_diagnostic.MA0039.severity = error
# Flow the cancellation token
dotnet_diagnostic.MA0040.severity = silent
dotnet_diagnostic.MA0040.severity = error
# Make property static
dotnet_diagnostic.MA0041.severity = silent
# Do not use blocking calls in an async method
Expand Down
2 changes: 2 additions & 0 deletions src/BizHawk.Client.Common/Api/ClientWebSocketWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public struct ClientWebSocketWrapper
public ClientWebSocketWrapper(Uri uri, CancellationToken? cancellationToken = null)
{
_w = new ClientWebSocket();
#pragma warning disable MA0040 // Analyzer not smart enough to recognise this
_w.ConnectAsync(uri, cancellationToken ?? CancellationToken.None).Wait();
#pragma warning restore MA0040
}

/// <summary>calls <see cref="ClientWebSocket.CloseAsync"/></summary>
Expand Down

0 comments on commit b818f53

Please sign in to comment.