Skip to content
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

New Rule S6966: Awaitable method should be used #9096

Closed
zsolt-kolbay-sonarsource opened this issue Apr 15, 2024 · 1 comment · Fixed by #9101 or #9179
Closed

New Rule S6966: Awaitable method should be used #9096

zsolt-kolbay-sonarsource opened this issue Apr 15, 2024 · 1 comment · Fixed by #9101 or #9179
Assignees
Labels
Area: C# C# rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

RSPEC: SonarSource/rspec#3854

@jilles-sg
Copy link

This rule may be useful to complete the final parts of an migration to async or to help prevent incorrect sync calls being added. However, there are cases where a normally asynchronous (I/O) type is synchronous, such as MemoryStream, StringReader, StringWriter or a StreamWriter that writes to a MemoryStream. In such cases, the asynchronous calls are unnecessary overhead. This is particularly nasty when await using has to be used with .ConfigureAwait(false), since a separate variable is required to store the ConfiguredAsyncDisposable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Projects
None yet
4 participants