Skip to content

Commit

Permalink
Align message to behavior for MA0157 (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindisch authored Jan 10, 2025
1 parent 54e9030 commit c939d72
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
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

0 comments on commit c939d72

Please sign in to comment.