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

Align message to behavior for MA0157 #783

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ If you are already using other analyzers, you can check [which rules are duplica
|[MA0154](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0154.md)|Design|Use langword in XML comment|ℹ️|✔️|✔️|
|[MA0155](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0155.md)|Design|Do not use async void methods|⚠️|❌|❌|
|[MA0156](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0156.md)|Design|Use 'Async' suffix when a method returns IAsyncEnumerable\<T\>|⚠️|❌|❌|
|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method does not return IAsyncEnumerable\<T\>|⚠️|❌|❌|
|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method returns IAsyncEnumerable\<T\>|⚠️|❌|❌|
|[MA0158](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0158.md)|Performance|Use System.Threading.Lock|⚠️|✔️|❌|
|[MA0159](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0159.md)|Performance|Use 'Order' instead of 'OrderBy'|ℹ️|✔️|✔️|
|[MA0160](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0160.md)|Performance|Use ContainsKey instead of TryGetValue|ℹ️|✔️|❌|
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
|[MA0154](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0154.md)|Design|Use langword in XML comment|<span title='Info'>ℹ️</span>|✔️|✔️|
|[MA0155](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0155.md)|Design|Do not use async void methods|<span title='Warning'>⚠️</span>|||
|[MA0156](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0156.md)|Design|Use 'Async' suffix when a method returns IAsyncEnumerable\<T\>|<span title='Warning'>⚠️</span>|||
|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method does not return IAsyncEnumerable\<T\>|<span title='Warning'>⚠️</span>|||
|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method returns IAsyncEnumerable\<T\>|<span title='Warning'>⚠️</span>|||
|[MA0158](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0158.md)|Performance|Use System.Threading.Lock|<span title='Warning'>⚠️</span>|✔️||
|[MA0159](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0159.md)|Performance|Use 'Order' instead of 'OrderBy'|<span title='Info'>ℹ️</span>|✔️|✔️|
|[MA0160](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0160.md)|Performance|Use ContainsKey instead of TryGetValue|<span title='Info'>ℹ️</span>|✔️||
Expand Down Expand Up @@ -641,7 +641,7 @@ dotnet_diagnostic.MA0155.severity = none
# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0156.severity = none
# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>
# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0157.severity = none
# MA0158: Use System.Threading.Lock
Expand Down Expand Up @@ -1137,7 +1137,7 @@ dotnet_diagnostic.MA0155.severity = none
# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0156.severity = none
# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>
# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0157.severity = none
# MA0158: Use System.Threading.Lock
Expand Down
2 changes: 1 addition & 1 deletion docs/Rules/MA0157.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MA0157 - Do not use 'Async' suffix when a method does not return IAsyncEnumerable\<T\>
# MA0157 - Do not use 'Async' suffix when a method returns IAsyncEnumerable\<T\>

Methods that do not return `IAsyncEnumerable<T>` should not have the Async suffix.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ dotnet_diagnostic.MA0155.severity = none
# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0156.severity = none

# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>
# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0157.severity = none

# MA0158: Use System.Threading.Lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ dotnet_diagnostic.MA0155.severity = none
# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0156.severity = none

# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>
# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable<T>
dotnet_diagnostic.MA0157.severity = none

# MA0158: Use System.Threading.Lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public sealed class MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyze

private static readonly DiagnosticDescriptor NotAsyncSuffixRuleAsyncEnumerable = new(
RuleIdentifiers.MethodsNotReturningIAsyncEnumerableMustNotHaveTheAsyncSuffix,
title: "Do not use 'Async' suffix when a method does not return IAsyncEnumerable<T>",
messageFormat: "Method not returning IAsyncEnumerable<T> must not use the 'Async' suffix",
title: "Do not use 'Async' suffix when a method returns IAsyncEnumerable<T>",
messageFormat: "Method returning IAsyncEnumerable<T> must not use the 'Async' suffix",
RuleCategories.Design,
DiagnosticSeverity.Warning,
isEnabledByDefault: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class TypeName
System.Collections.Generic.IAsyncEnumerable<int> {|MA0157:FooAsync|}() => throw null;
}
""")
.ShouldReportDiagnosticWithMessage("Method not returning IAsyncEnumerable<T> must not use the 'Async' suffix")
.ShouldReportDiagnosticWithMessage("Method returning IAsyncEnumerable<T> must not use the 'Async' suffix")
.ValidateAsync();

[Fact]
Expand Down
Loading