Skip to content
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ If you are already using other analyzers, you can check [which rules are duplica
|[MA0191](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0191.md)|Design|Do not use the null-forgiving operator|⚠️|❌|❌|
|[MA0192](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0192.md)|Usage|Use HasFlag instead of bitwise checks|ℹ️|❌|✔️|
|[MA0193](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0193.md)|Usage|Use an overload with a MidpointRounding argument|ℹ️|✔️|✔️|
|[MA0194](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0194.md)|Usage|Merge is expressions on the same value|ℹ️|✔️|✔️|

<!-- rules -->

Expand Down
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
|[MA0191](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0191.md)|Design|Do not use the null-forgiving operator|<span title='Warning'>⚠️</span>|❌|❌|
|[MA0192](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0192.md)|Usage|Use HasFlag instead of bitwise checks|<span title='Info'>ℹ️</span>|❌|✔️|
|[MA0193](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0193.md)|Usage|Use an overload with a MidpointRounding argument|<span title='Info'>ℹ️</span>|✔️|✔️|
|[MA0194](https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0194.md)|Usage|Merge is expressions on the same value|<span title='Info'>ℹ️</span>|✔️|✔️|

|Id|Suppressed rule|Justification|
|--|---------------|-------------|
Expand Down Expand Up @@ -783,6 +784,9 @@ dotnet_diagnostic.MA0192.severity = none

# MA0193: Use an overload with a MidpointRounding argument
dotnet_diagnostic.MA0193.severity = suggestion

# MA0194: Merge is expressions on the same value
dotnet_diagnostic.MA0194.severity = suggestion
```

# .editorconfig - all rules disabled
Expand Down Expand Up @@ -1360,4 +1364,7 @@ dotnet_diagnostic.MA0192.severity = none

# MA0193: Use an overload with a MidpointRounding argument
dotnet_diagnostic.MA0193.severity = none

# MA0194: Merge is expressions on the same value
dotnet_diagnostic.MA0194.severity = none
```
14 changes: 14 additions & 0 deletions docs/Rules/MA0194.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MA0194 - Merge is expressions on the same value
<!-- sources -->
Sources: [MergeIsPatternChecksAnalyzer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer/Rules/MergeIsPatternChecksAnalyzer.cs), [MergeIsPatternChecksFixer.cs](https://github.com/meziantou/Meziantou.Analyzer/blob/main/src/Meziantou.Analyzer.CodeFixers/Rules/MergeIsPatternChecksFixer.cs)
<!-- sources -->

````c#
value is 1 || value is 2; // not compliant

value is 1 or 2; // ok

value is MyEnum.Value1 && value is not MyEnum.Value2; // not compliant

value is MyEnum.Value1 and not MyEnum.Value2; // ok
````
Loading
Loading