Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

force whitespace between ')' and '{' [closed]

Tags:

checkstyle

in our code we sometimes have this

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

I'm currently trying to configure my 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 anybody know the correct checkstyle configuration for this particular setup? I want to check this code as part of my gradle build

like image 317
Rene Groeschke Avatar asked Aug 08 '14 11:08

Rene Groeschke


1 Answers

If you use eclipse you could have a look at "Window/Preferences/Java/Code Style/Formatter". You can set almost everything.

For your problem :

Here

If you want use checkstyle you can go to "Window/Preferences/Checkstyle/New ...". And doing some thing like that : Here

like image 114
L. Quastana Avatar answered Oct 27 '22 01:10

L. Quastana