abap-cleaner icon indicating copy to clipboard operation
abap-cleaner copied to clipboard

Feature request: Move logic directly after condition (`IF`, `WHEN`) to next line

Open ConjuringCoffee opened this issue 2 years ago • 1 comments

Hi Jörg-Michael, to avoid problems like in #207 I'd like to request a rule that moves logic directly after a condition to the next line.

Example:

    DATA example TYPE string.

    IF example = 'when'. call_example( i_1 = 1
               i_2 = 2 ).
    ENDIF.

Expected:

    DATA example TYPE string.

    IF example = 'when'.
      call_example( i_1 = 1
                    i_2 = 2 ).
    ENDIF.

Maybe this could be considered by a more general rule like "Move statements from one line to multiple lines."

What do you think? 🙂

ConjuringCoffee avatar Nov 20 '23 10:11 ConjuringCoffee

Hi ConjuringCoffee,

yes, that's a good idea – and also explicitly demanded by the styleguide: No more than one statement per line!

Kind regards, Jörg-Michael

jmgrassau avatar Nov 20 '23 12:11 jmgrassau