Allow fix values for empty lines at method start and end
Currently the rule Standardize empty lines within methods allows to set max values for empty lines at method start and end.
Thus, it is not possible to enforce consistency without setting the value of both options to 0.
To allow consistency for values different from 0 I propose to allow setting the given values as fix values, meaning if empty lines at method start and end is set to 1, a line is being added, if none existed.
Example
Option: Max empty lines at method start: 1 Max empty lines at method end: 1
original code
METHOD empty_lines.
FIELD-SYMBOLS <ls_data> TYPE any_type.
" comment above executable statement
DATA(lo_utility) = cl_factory=>get( )->get_utility( ).
ENDMETHOD.
formatted with max values
METHOD empty_lines.
-
FIELD-SYMBOLS <ls_data> TYPE any_type.
" comment above executable statement
DATA(lo_utility) = cl_factory=>get( )->get_utility( ).
ENDMETHOD.
formatted with fixed values
METHOD empty_lines.
-
FIELD-SYMBOLS <ls_data> TYPE any_type.
" comment above executable statement
DATA(lo_utility) = cl_factory=>get( )->get_utility( ).
+
ENDMETHOD.
Hi Benedikt,
yes, that makes sense – just not sure yet about the wording: add settings for "Min empty lines at method start/end" (making sure they don't contradict)?
Kind regards, Jörg-Michael
add settings for "Min empty lines at method start/end" (making sure they don't contradict)?
I would not need a range at all, meaning my team always sets min equal to the max value to force consistency. But, if you want to allow a range, your proposal makes sense.