larshp/abapOpenChecks

Line with only ")" or "." - Bad Indentation (Check 16)

g-back opened this issue · 2 comments

If you want to discourage this, there's check 20.
If you want to allow it, check 16 (Bad Indentation) also marks it as a finding.

Example:

DATA(material) = VALUE mara(
  matnr = 'X'
  mtart = 'Y' ).

If you'd want to put the parenthesis on a separate line, the indentation should be (imo) on the same level as the "starting" statement:

DATA(material) = VALUE mara(
  matnr = 'X'
  mtart = 'Y' 
).

Another, more complex example:

    output = CORRESPONDING #(
      object->method(
        param1 = p1
        param2 = p2
      ) 
    ).

This would cause a finding. This would not:

DATA(material) = VALUE mara(
  matnr = 'X'
  mtart = 'Y' 
  ).

I'm not sure how to best handle this, maybe add a setting to ignore the indentation of the trailing parentheses, if it's on a separate line?

well, I think the easiest is to write a new check which enforces the behavior you like, it wont break anything...

Well my point was that I don't want to enforce how trailing parentheses should be indented - and I want to keep using this check without the "false positives". But fair enough, think I'll just modify the check to fit my needs, thanks.