Skip to content

Commit

Permalink
Add documentation for MA0156 and MA0157
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou committed Apr 28, 2024
1 parent b96e6f4 commit 01206ef
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ If you are already using other analyzers, you can check [which rules are duplica
|[MA0153](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0153.md)|Design|Do not log symbols decorated with DataClassificationAttribute directly|⚠️|✔️||
|[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\>|⚠️|||

<!-- rules -->

Expand Down
14 changes: 14 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@
|[MA0153](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0153.md)|Design|Do not log symbols decorated with DataClassificationAttribute directly|<span title='Warning'>⚠️</span>|✔️||
|[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>|||

|Id|Suppressed rule|Justification|
|--|---------------|-------------|
Expand Down Expand Up @@ -626,6 +628,12 @@ dotnet_diagnostic.MA0154.severity = suggestion
# MA0155: Do not use async void methods
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>
dotnet_diagnostic.MA0157.severity = none
```

# .editorconfig - all rules disabled
Expand Down Expand Up @@ -1092,4 +1100,10 @@ dotnet_diagnostic.MA0154.severity = none
# MA0155: Do not use async void methods
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>
dotnet_diagnostic.MA0157.severity = none
```
11 changes: 11 additions & 0 deletions docs/Rules/MA0156.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MA0156 - Use 'Async' suffix when a method returns IAsyncEnumerable\<T\>

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

````c#
// compliant
IAsyncEnumerable<string> FooAsync() => throw null;

// non-compliant
IAsyncEnumerable<string> Foo() => throw null;
````
11 changes: 11 additions & 0 deletions docs/Rules/MA0157.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# MA0157 - Do not use 'Async' suffix when a method does not return IAsyncEnumerable\<T\>

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

````c#
// compliant
IAsyncEnumerable<string> Foo() => throw null;

// non-compliant
IAsyncEnumerable<string> FooAsync() => throw null;
````

0 comments on commit 01206ef

Please sign in to comment.