sp_before_sparen

Add or remove space before ( of control statements (if, for, switch, while etc.).

Possible values are ignore, add, remove and force. Default ignore.

Note, there are some special cases for this option: sp_catch_paren, sp_version_paren and sp_scope_paren.

Examples

add

Code before:

if(x<20) sum = 30;

for(int i=0; i<x; i++) {
  sum = sum+i;
}

Code after:

if (x<20) sum = 30;

for (int i=0; i<x; i++) {
  sum = sum+i;
}

remove

Code before:

if (x<20) sum = 30;

for  (int i=0; i<x; i++) {
  sum = sum+i;
}

Code after:

if(x<20) sum = 30;

for(int i=0; i<x; i++) {
  sum = sum+i;
}

See also