0

While working on a project I need to format my Java code in a specific manner. If it is not formatted in correct way, the build will create problems:

Correct way:

public static void main(String[] args)
{
  // Code
}

Incorrect way: //Check the braces

public static void main (String[] args) {
  //code
}

Does any one know for this purpose, which checkstyle should be used/configured in Eclipse?

0

1 Answer 1

1

which checkstyle should be used/configured in Eclipse?

The checkstyle rule LeftCurly defines the placement of left curly braces:

  • eol: The brace must always be on the end of the line.
  • nl: The brace must always be on a new line.
  • nlow: Apply either eol or nl depending on the length of the line.

See also the LeftCurly rule in the Block Checks category and the Lcurly property.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.