dotnet / dotnet/roslynator

RCS1031 conflicts with RCS1111

Open
#651 2 comments 1 reaction 1 assignee Claimed by @josefpihrt View on GitHub
Area-Analyzers
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

**Product and Version Used**:
Roslynator 2.3.0
Visual Studio 2017, 15.9.19
**Steps to Reproduce**:
Consider a trivial switch-case where sections have multiple statements:
```csharp
public void TestSwitch(int param)
{
switch (param)
{
case 1:
Console.WriteLine("a");
break;
case 2:
{
Console.WriteLine("b");
break;
}
}
}
```
Also consider that both RCS1031 and RCS1111 are included into the ruleset.
Case 1 will cause RCS1111 requiring to add the braces, but case 2 will cause RCS1031 requiring to remove the braces.
**Actual Behavior**:
RCS1031 confilcts with RCS1111
**Expected Behavior**:
RCS1031 and RCS1111 have same opinion about the necessity of braces in this case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.