Skip to content

"Standardize empty lines within methods" deletes lines when applied but let them live in profile settings #195

Closed

Description

@VladGhitulescu

Hey,

I have a problem with the rule "Standardize empty lines within methods" deleting lines in code when the ABAP Cleaner runs - the same code behaves different when pasted in the configuration window.

Here is the code in the configuration window:

CleanShot 2023-11-10 at 13 24 42

I'd like to preserve the 2 empty lines (row-nr. 4 and 5) between DATA and the FREE-statement so I set the "Max. empty lines within methods"-parameter to 2.
It looks like the lines would be preserve BUT

CleanShot 2023-11-10 at 13 25 42@2x

as soon as I run the ABAP Cleaner one of the lines get deleted.

Could you please help me with this?

Thanks!

Regards,
Vlad

Activity

  1. jmgrassau commented on Nov 11, 2023

    @jmgrassau
    Member

    Hi Vlad,

    that's a good point – this is done by the rule "Rearrange local declarations" (even if it has nothing to rearrange in this case). It would indeed be better if "Rearrange local declarations" observed the setting from "Standardize empty lines within methods"!

    Another issue is that if "Rearrange local declarations" changes something (even the number of line breaks), it should be displayed in the "Rule Used in Current Selection" list in the main window, which was not the case when I tried the scenario.

    Kind regards,
    Jörg-Michael

  2. VladGhitulescu commented on Nov 11, 2023

    @VladGhitulescu
    Author

    Hi JM,

    which parameter of "Rearrange local declarations" does this?

    Regards,
    Vlad

  3. self-assigned this
    on Nov 12, 2023
  4. jmgrassau commented on Nov 12, 2023

    @jmgrassau
    Member

    Hi Vlad,

    there is no parameter for this in "Rearrange local declarations" – but I now changed the rule to simply keep multiple empty lines if they are found in such cases, so this will be fixed with the next release.

    Kind regards,
    Jörg-Michael

  5. VladGhitulescu commented on Nov 12, 2023

    @VladGhitulescu
    Author

    Thanks JM!

  6. jmgrassau commented on Nov 13, 2023

    @jmgrassau
    Member

    Hi Vlad,

    this should now be fixed with version 1.11.1, which was just released!

    Kind regards,
    Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions