user2560179
user2560179

Reputation: 1

Eclipse java/ant checkstyle issue

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?

Upvotes: 0

Views: 77

Answers (1)

Andreas Fester
Andreas Fester

Reputation: 36630

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.

Upvotes: 1

Related Questions