-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
MA0157 phrasing is unclear #782
Comments
If you want to enforce the naming convention:
|
Thanks for pointing this out, it makes sense when you say it like that. However I'm still a bit confused because
That's why I'm so confused with the error message of MA0157, because the code example is for a case where an async enumerable is returned, but the error says "Do not use 'Async' suffix when a method does not return IAsyncEnumerable". |
You are right for MA0137 and MA0138. For |
Ah I'm beginning to understand! Then the only thing that throws me off is the message for MA0157, wouldn't it be more accurate to put it like in #783? |
Thanks for the PR! The message will be much clearer :) |
Thanks for your help 👍 |
Version of the Meziantou.Analyzer NuGet package
2.0.185
Rule Identifier
MA0157
Target Framework
net9.0
C# Language version
C# 13
Description
Updated the issue because at first I thought it was a bug, now I think I'm just confused :)
Based on the examples for MA0156
and MA0157
it looks like they're mutually exclusive. The first is for when you want an
Async
suffix for methods that return anIAsyncEnumerable<T>
and the second is for when you don't want that. So we can choose which style we prefer by enabling either one of them.If my understanding is correct, then the naming "MA0157 - Do not use 'Async' suffix when a method does not return IAsyncEnumerable" seems confusing and doesn't represent what's going on. Because it's still about cases that do return an
IAsyncEnumerable<T>
. Am I getting this right?The text was updated successfully, but these errors were encountered: