Looking for a Checkstyle rule to enforce empty lines in some situations:
Empty Line After Close Curly
if (something)
{
// not important
}
doSomethingElse();
Empty Line Before Return
final var result = doSomething();
return result;
Looking for a Checkstyle rule to enforce empty lines in some situations:
Empty Line After Close Curly
if (something)
{
// not important
}
doSomethingElse();
Empty Line Before Return
final var result = doSomething();
return result;
I ended up adding a simple RegexpMultiline module which should work for now thought it may not catch all cases:
<!-- Enforces blank lines after block-closing curly braces (with exceptions). -->
<module name="RegexpMultiline">
<property name="format" value="}\n(?![ \t]*(else|case|catch|finally|[})]|\*)|$)"/>
</module>