Prevent empty brackets with whitespace or newlines

Answered

Simply put, if a method has no code in it but only whitespace and/or newlines, I would like to remove said whitespace and/or newlines.

 

Let's give three examples of methods (can apply to if statements or anything else with brackets) that I would not want.

void example() {   }

void example() {

}

void example() {

   }

 

This would be the format I would want:

void example() {}

 

How can I find and fix cases like these, and is it possible to add that to my code style scheme?

0

Please sign in to leave a comment.