New line before if statement

Answered

Hi!
Is it possible to configure in Intelij code style to add a new line before each 'if' statement ?

Example:

I have:

var student = request.getStudent();

/....../ - some code

if (Object.isNull(student)) {

doSmth();

}

 

what I want:

var student = request.getStudent();

/....../ - some code

 

if (Object.isNull(student)) {

doSmth();

}

the difference is that in the second variant before if statement there is additional line. I want Intelij to add that line every time I use formatting. It can help when the developer doesnt pay attention on separating some block of codes into logical parts.

I tried code style for Java and .editorconfig and didnt find anything suitable. 

0

Please sign in to leave a comment.