removing blank lines before 'else'

I have a colleague who likes to add blank lines before the else in an if-else statement, against rules. 

    if (a == 2)
        a++;

    else if (a == 4)
    {
        a = res1;
        a++;
    }

How can I set resharper to remove that blank line? I don't want to manually go regex'ing to remove them.

0
1 comment

Hello,

R# built-in formatter can't do that currently. There's the “Keep max blank lines in code” setting but it affects all blank lines. I've filed https://youtrack.jetbrains.com/issue/RSCPP-35001/. You can switch to clang-format, but I don't think it can do that as well.

Thanks for the feedback!

1

Please sign in to leave a comment.