How to enforce "No blank lines after opening curly brackets/before closing curly brackets" (SA1506/SA1508)


How can I setup Resharper code inspections to warn about blank lines next to opening and closing curly brackets?

Specifically, to prevent violation of these two StyleCop rules:


Note: I cannot use any StyleCop plugin.. we're writing a dotnet core project where StyleCop support is too poor and I had to switch to R# Inspections for code quality control in the CI builds.


1 comment
Comment actions Permalink

Hello Fabian!


Thank you for contacting us.

There's no option to setup such rules using ReSharper inspections, however you can use ReSharper reformatting with turned on ReSharper | Options | Code Editing | C# | Formatting Style | Blank lines | Remove blank lines after "{" and before "}" in declarations and Remove blank lines after "{" and before "}" in code.

Thank you.


Please sign in to leave a comment.