Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCS1208 refactoring incorrectly indents opening brace of method #891

Closed
xt0rted opened this issue Mar 31, 2022 · 0 comments
Closed

RCS1208 refactoring incorrectly indents opening brace of method #891

xt0rted opened this issue Mar 31, 2022 · 0 comments

Comments

@xt0rted
Copy link
Contributor

xt0rted commented Mar 31, 2022

Product and Version Used: 4.1.0

Steps to Reproduce:

.editorconfig

# RCS1208: Reduce 'if' nesting
dotnet_diagnostic.RCS1208.severity = suggestion
private void Stuff(string? value)
{
    MoreStuff(value); // doesn't matter if this line is here

    if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    {
        MoreStuff(value);
    }
}

private void MoreStuff(string? value)
{
}

Actual Behavior:

private void Stuff(string? value)
    { // <- this shouldn't be indented
    MoreStuff(value);

    if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    {
        return;
    }

    MoreStuff(value);
}

Expected Behavior:

private void Stuff(string? value)
{
    MoreStuff(value);

    if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
    {
        return;
    }

    MoreStuff(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants