diff --git a/README.md b/README.md index c5b9ba2a..d818a9dd 100755 --- a/README.md +++ b/README.md @@ -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\|⚠️|❌|❌| -|[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\|⚠️|❌|❌| +|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method returns IAsyncEnumerable\|⚠️|❌|❌| |[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|ℹ️|✔️|❌| diff --git a/docs/README.md b/docs/README.md index e84882da..e4b39cda 100755 --- a/docs/README.md +++ b/docs/README.md @@ -156,7 +156,7 @@ |[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\|⚠️|❌|❌| -|[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\|⚠️|❌|❌| +|[MA0157](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md)|Design|Do not use 'Async' suffix when a method returns IAsyncEnumerable\|⚠️|❌|❌| |[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|ℹ️|✔️|❌| @@ -641,7 +641,7 @@ dotnet_diagnostic.MA0155.severity = none # MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0156.severity = none -# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable +# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0157.severity = none # MA0158: Use System.Threading.Lock @@ -1137,7 +1137,7 @@ dotnet_diagnostic.MA0155.severity = none # MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0156.severity = none -# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable +# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0157.severity = none # MA0158: Use System.Threading.Lock diff --git a/docs/Rules/MA0157.md b/docs/Rules/MA0157.md index eab1b3f0..5ac58c85 100644 --- a/docs/Rules/MA0157.md +++ b/docs/Rules/MA0157.md @@ -1,4 +1,4 @@ -# MA0157 - Do not use 'Async' suffix when a method does not return IAsyncEnumerable\ +# MA0157 - Do not use 'Async' suffix when a method returns IAsyncEnumerable\ Methods that do not return `IAsyncEnumerable` should not have the Async suffix. diff --git a/src/Meziantou.Analyzer.Pack/configuration/default.editorconfig b/src/Meziantou.Analyzer.Pack/configuration/default.editorconfig index 547b0436..e33f1b70 100644 --- a/src/Meziantou.Analyzer.Pack/configuration/default.editorconfig +++ b/src/Meziantou.Analyzer.Pack/configuration/default.editorconfig @@ -467,7 +467,7 @@ dotnet_diagnostic.MA0155.severity = none # MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0156.severity = none -# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable +# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0157.severity = none # MA0158: Use System.Threading.Lock diff --git a/src/Meziantou.Analyzer.Pack/configuration/none.editorconfig b/src/Meziantou.Analyzer.Pack/configuration/none.editorconfig index c02bf124..59ec6124 100644 --- a/src/Meziantou.Analyzer.Pack/configuration/none.editorconfig +++ b/src/Meziantou.Analyzer.Pack/configuration/none.editorconfig @@ -467,7 +467,7 @@ dotnet_diagnostic.MA0155.severity = none # MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0156.severity = none -# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable +# MA0157: Do not use 'Async' suffix when a method returns IAsyncEnumerable dotnet_diagnostic.MA0157.severity = none # MA0158: Use System.Threading.Lock diff --git a/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs b/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs index 064e46e0..fec78c89 100644 --- a/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs +++ b/src/Meziantou.Analyzer/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzer.cs @@ -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", - messageFormat: "Method not returning IAsyncEnumerable must not use the 'Async' suffix", + title: "Do not use 'Async' suffix when a method returns IAsyncEnumerable", + messageFormat: "Method returning IAsyncEnumerable must not use the 'Async' suffix", RuleCategories.Design, DiagnosticSeverity.Warning, isEnabledByDefault: false, diff --git a/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs b/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs index 4cbecce6..8082d72c 100644 --- a/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs +++ b/tests/Meziantou.Analyzer.Test/Rules/MethodsReturningAnAwaitableTypeMustHaveTheAsyncSuffixAnalyzerTests.cs @@ -157,7 +157,7 @@ class TypeName System.Collections.Generic.IAsyncEnumerable {|MA0157:FooAsync|}() => throw null; } """) - .ShouldReportDiagnosticWithMessage("Method not returning IAsyncEnumerable must not use the 'Async' suffix") + .ShouldReportDiagnosticWithMessage("Method returning IAsyncEnumerable must not use the 'Async' suffix") .ValidateAsync(); [Fact]