home  

nl_after_return

Properties

  Category: Newline adding and removing options
      Type: boolean [false, true]
   Default: false

Description

Whether to put a blank line after 'return' statements, unless followed by a
close brace.

Examples

raw CPP code nl_after_return=false nl_after_return=true nl
nl_after_return=true
int f(int a){ if(a) return 1; else return 2; switch(a){ case 1: return 3; case 2: { return 4; } default: return 5; } return 6; a++; } int f(int a){ if(a) return 1; else return 2; switch(a){ case 1: return 3; case 2: { return 4; } default: return 5; } return 6; a++; } int f(int a){ if(a) return 1; else return 2; switch(a){ case 1: return 3; case 2: { return 4; } default: return 5; } return 6; a++; } int f(int a){ if(a) return 1; else return 2; switch(a){ case 1: return 3; case 2: { return 4; } default: return 5; } return 6; a++; }
 

Info

  No blank line added after 'return 1;'. Bug ?
  Looks like the tracking is not working
  Edited by JEAYNE

Not the best code for this option? See how to improve the .uds file used to generate these examples.