-
Notifications
You must be signed in to change notification settings - Fork 0
Scalastyle proposed rules (Block Checks)
This page contains proposed rules for Scalastyle, for the category Block Checks.
Checks for empty blocks.
Checks for the placement of left curly braces ('{') for code blocks. The policy to verify is specified using property option.
Checks for braces around code blocks.
Checks the placement of right curly braces ('}') for else, try, and catch tokens. The policy to verify is specified using property option.
Finds nested blocks, i.e. blocks that are used freely in the code. Rationale: Nested blocks are often leftovers from the debugging process, they confuse the reader.
For example this Check finds the obsolete braces in
public void guessTheOutput() { int whichIsWich = 0; { int whichIsWhich = 2; } System.out.println("value = " + whichIsWhich); }
and debugging / refactoring leftovers such as // if (conditionThatIsNotUsedAnyLonger) { System.out.println("unconditional"); }