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

Add 'insert empty line before ANY statement' option to rule "Standardize empty lines within methods"

Open hansdampfinger666 opened this issue 1 year ago • 1 comments

I'm in the "always inline declare and define and declare and define as close as possible to definitions" and not the "declare all variables at the start of any function" crowd.

So it'd be nice to have an option in the rule "Standardize empty lines within methods" rule, that instead of adding an empty line before any executable statement adds an empty line before any statement in a method.

This would maybe require a checkbox so either or option can be chosen.

So this:

  METHOD get_next_config_id.

    DATA lt_sddocs TYPE TABLE OF sales_key.
    lt_sddocs = VALUE #( ( vbeln = mv_contract ) ).
    DATA lt_cucfg TYPE TABLE OF bapicucfgm.

Doesn't get changed to this:

  METHOD get_next_config_id.

    DATA lt_sddocs TYPE TABLE OF sales_key.

    lt_sddocs = VALUE #( ( vbeln = mv_contract ) ).
    DATA lt_cucfg TYPE TABLE OF bapicucfgm.

Thanks all for your amazing work.

hansdampfinger666 avatar Jun 14 '24 20:06 hansdampfinger666

This would be indeed an good option. Old legacy programmers prefer the second style. Based on the clean code samples, the first style would be also nice.

mAltr avatar Jun 18 '24 23:06 mAltr