SAP / abap-cleaner

ABAP cleaner applies 75+ cleanup rules to ABAP code at a single keystroke
Apache License 2.0
387 stars 42 forks source link

Align SELECT...FROM...JOIN #332

Open JoachimEck opened 6 days ago

JoachimEck commented 6 days ago

Hey,

I think something is not rigth with the "Align SELECT ... FROM ... JOIN" rule. I was wondering why the Cleaner kept messing up the formatting in a SELECT. I'm using version 1.16.2.

  1. align AS always seems to be done, regardless of the checkbox image image

  2. if I turn on the checkbox for the "Align ON", then it moves the ON behind the upper ON condition. If the checkbox is off, then it does what I would have expected if the checkbox was on image image

Maybe I just misinterpreted the options and everything is as it should be 😄

 SELECT *
      FROM test
           JOIN join_one ON test~aufnr = jo~aufnr
           JOIN join_two        
                        ON  test~aufnr = jt~aufnr
                                        AND test~werks = jt~werks
      INTO CORRESPONDING FIELDS OF TABLE @lt_table. 

Here is my profile: profile.zip

Best regards, Joachim

jmgrassau commented 6 days ago

Hi Joachim,

thanks a lot for reporting this – ABAP cleaner didn't correctly determine the end of first the logical expressions here (ON …), which only happened if it was followed by JOIN (rather than INNER JOIN, LEFT|RIGHT OUTER JOIN, CROSS JOIN). This will be fixed with the next release, and with that, the options should work as expected.

image

image

Kind regards, Jörg-Michael