Format space between ')' and '{'

in our code we sometimes have this

public class Demo{ public String value(){ if (something){ while(true){ ... } } } } 

I'm currently trying to set up a checkstyle configuration to force developers to have a space before '{':

 public class Demo { public String value() { if (something) { while(true) { ... } } } } 

but I can't get it to work. Does anyone know the correct checkstyle configuration for this particular installation? I want to check this code as part of my gradle assembly

+7
checkstyle
source share
1 answer

If you use eclipse, you can take a look at "Window / Preferences / Java / Code Style / Formatter". You can install almost everything.

For your problem:

Here

If you want to use checkstyle, you can go to "Window / Preferences / Checkstyle / New ...". And something like this: Here

+3
source share

All Articles