Left curly braces should be located at the end of lines of code

  • squid : LeftCurlyBraceEndLineCheck

Sharing some coding conventions is a key point to make it possible for a team to efficiently collaborate. This rule make it mandatory to place left curly braces at the end of lines of code.

The following code snippet illustrates this rule:

public void myMethod() {              // Compliant
  if(something)
  {                                   // Non-Compliant
    executeTask();
  } else {                            // Compliant
    doSomethingElse();
  }
  if( param1 && param2 && param3
    && something3 && something4)
  {                                   // Non-Compliant
    executeAnotherTask();
  }
}
Close