8000 Remove unnecessary CA2022 suppressions by Winniexu01 · Pull Request #48766 · dotnet/sdk · GitHub
[go: up one dir, main page]

Skip to content

Remove unnecessary CA2022 suppressions #48766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove unnecessary CA2022 suppressions
  • Loading branch information
Winniexu01 committed Apr 29, 2025
commit 6053ce3b2e8d1c48535ce2144156cb87b2072fa6
4 changes: 1 addition & 3 deletions src/RazorSdk/Tool/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation
try
{
ServerLogger.Log($"Before poking pipe {Identifier}.");
#pragma warning disable CA2022 // Avoid inexact read
await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
#pragma warning restore CA2022
_ = await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider leaving comments explaining why we can't use ReadExactAsync so someone doesn't try to "fix" that in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: 3137672

ServerLogger.Log($"After poking pipe {Identifier}.");
}
catch (OperationCanceledException)
Expand Down
4 changes: 1 addition & 3 deletions src/RazorSdk/Tool/ConnectionHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ public override async Task WaitForDisconnectAsync(CancellationToken cancellation
try
{
ServerLogger.Log($"Before poking pipe {Identifier}.");
#pragma warning disable CA2022 // Avoid inexact read
await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
#pragma warning restore CA2022
_ = await Stream.ReadAsync(Array.Empty<byte>(), 0, 0, cancellationToken);
ServerLogger.Log($"After poking pipe {Identifier}.");
}
catch (OperationCanceledException)
Expand Down
0