SAP / abap-cleaner

ABAP cleaner applies 95+ cleanup rules to ABAP code at a single keystroke
Apache License 2.0
451 stars 48 forks source link

Flag to disable rules incompatible with SAP Gui #262

Open bnichell opened 8 months ago

bnichell commented 8 months ago

When an object is changed in the SAP Gui, it can lead to unrelated formatting changes in the coding of that object. For instance, if a method signature is being adjusted in the Form Editor, the ! are being added to the parameter and the casing is changed.

For this reason, I propose to add a flag, with disables all rules that are affected by this incompatibility with editing ABAP in the SAP Gui.

In addition, for some rules it is not possible to only disable formatting that could be automatically changed by the SAP Gui. E.g. the rule Convert upper and lower case has the settings Keywords/Identifiers in all other places, which also includes the class name or method names in the implementation part and these parts could be automatically adjusted by the SAP Gui. Thus, it could make sense, to allow to only partially disable formatting, which could be automatically adjusted again by the SAP Gui.

jmgrassau commented 5 months ago

Hi Benedikt,

just to be sure, you would mean for such a flag to be part of the main window's "Cleanup Settings", i.e. on a similar level as "Restrict rules to syntax of: …", right? So, cleanup rules that (fully or partially or in case of certain configuration) conflict with PrettyPrinter could be active in a profile, but would still be suppressed if the flag is set?

That's conceivable but might get rather tricky, given all the combinations of options that you could set. But yes, I've heard of teams that are still in the process of convincing some colleagues of the advantages of ADT…

Kind regards, Jörg-Michael

bnichell commented 5 months ago

Hi Jörg-Michael,

yes, your understanding is (mostly) correct.

So, cleanup rules that (fully or partially or in case of certain configuration) conflict with PrettyPrinter could be active in a profile, but would still be suppressed if the flag is set?

I think some incompatibilities also come from the backend editor without using pretty printer, e.g. after editing the declaration part in the form editor the, e.g. the casing is adjusted automatically. We also faced some undesired formatting changes when using gCTS, though these might be resolved in the future by the gCTS colleagues.

Cheers, Benedikt