java - Use checkstyle to require space on either side of equals -


how set checkstyle enforce following:

int = 0; if(i == 0) {     // } if(i > 0) {     // } 

instead of:

int i=0; if(i==0) {     // } if(i>0) {     // } 

the rule name whitespacearound , can set in checkstyle xml file:

<module name="whitespacearound">   <property name="tokens" value="assign,band,band_assign,bor,bor_assign,bsr,bsr_assign,bxor,bxor_assign,colon,div,div_assign,equal,ge,gt,land,le,literal_assert,literal_catch,literal_do,literal_else,literal_finally,literal_for,literal_if,literal_return,literal_synchronized,literal_try,literal_while,lor,lt,minus,minus_assign,mod,mod_assign,not_equal,plus,plus_assign,question,sl,slist,sl_assign,sr,sr_assign,star,star_assign,literal_assert,type_extension_and,wildcard_type"/> </module> 

you can refer following url: http://checkstyle.sourceforge.net/config_whitespace.html


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -