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

"Align logical expression" - Needless Spaces

Open hypo1989 opened this issue 1 year ago • 2 comments

The Equal-Sign is moved, although the IS NOT INITIAL is not aligned, because the limit of inner spaces is exceeded.

image

The limit ist not exceeded it look right. image

hypo1989 avatar Jan 19 '24 13:01 hypo1989

Hi hypo1989,

this option was actually meant that way! Think of a more extreme example:

image

I guess you wouldn't want the first comparison operator to be aligned, because you could hardly realize that the line goes on after is_buffer-id

  CHECK     is_buffer-id                           > 3
        AND is_buffer-any_flag_with_long_name      = abap_false
        AND is_buffer-other_flag_with_long_name    = abap_false
        AND is_buffer-third_flag_with_longest_name = abap_true.

… but it would be a pity if that meant that none of them could be aligned:

  CHECK     is_buffer-id > 3
        AND is_buffer-any_flag_with_long_name = abap_false
        AND is_buffer-other_flag_with_long_name = abap_false
        AND is_buffer-third_flag_with_longest_name = abap_true.

Therefore, the option changes everything that can be aligned without inserting too many spaces:

  CHECK     is_buffer-id > 3
        AND is_buffer-any_flag_with_long_name      = abap_false
        AND is_buffer-other_flag_with_long_name    = abap_false
        AND is_buffer-third_flag_with_longest_name = abap_true.

Kind regards, Jörg-Michael

jmgrassau avatar Feb 09 '24 13:02 jmgrassau

Yes but i think in line 4 and 5 there is one blank too many inserted. It depends on the IS NOT INITIAL. image

hypo1989 avatar Feb 14 '24 15:02 hypo1989