RL0940 - Ensures the source files has the proper blank line whitespace

Source files must be layed out with proper whitespace. Some keyword statements are tested to ensure they have proper whitespace (a blank line) before or after the statement.

The following language statements require a blank line, closing bracket, or comment immediate before

else if (condition)
for (...)
foreach (...)
if (condition)
lock (mutex)
switch (value)
while (condition)
using (variable)
class MyClass
interface IInterface
namespace MyNamespace
return
try

The following language statements must not have a blank line immediately before or after

case MyValue:
break;

The following language elements must adhere to the following

  • the following line can be a bracket
  • the following line can be blank if the following one has a bracket
  • the following line contains one of the following

else
catch
finally
else if
#endregion
return
default:
case
break
get
set
while

NOTE: future versions of this rule will provide individual language keyword configuration.