Skip to content

ENUM definitions are not aligned #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kjetil-kilhavn opened this issue Nov 10, 2023 · 3 comments
Closed

ENUM definitions are not aligned #194

kjetil-kilhavn opened this issue Nov 10, 2023 · 3 comments
Assignees

Comments

@kjetil-kilhavn
Copy link

The following code is not changed at all by ABAP cleaner

    TYPES:
      BEGIN OF ENUM cost_distribution BASE TYPE vrtkz,
        not_distributed VALUE IS INITIAL,
        by_quantity VALUE '1',
        by_percentage VALUE '2',
        by_amount VALUE '3',
      END OF ENUM cost_distribution.

It would make sense that ABAP Cleaner aligns the VALUE parts of ENUMs, for instance as shown below

    TYPES:
      BEGIN OF ENUM cost_distribution BASE TYPE vrtkz,
        not_distributed VALUE IS INITIAL,
        by_quantity     VALUE '1',
        by_percentage   VALUE '2',
        by_amount       VALUE '3',
      END OF ENUM cost_distribution.
@jmgrassau
Copy link
Member

Hi Kjetil,

good point, thanks for the suggestion! Let me set a "new option" label for now, but we'd have to check whether this should be a new option to the "Align declarations" rule or rather a new cleanup rule.

Kind regards,
Jörg-Michael

@jmgrassau jmgrassau self-assigned this Dec 30, 2023
@jmgrassau
Copy link
Member

Hi Kjetil,

thanks again for opening this! With the next release, the "Align declarations" rule will have this new option:

image

Example:

image

Existing one-liners are kept …

image

… unless they come with VALUEs:

image

Kind regards,
Jörg-Michael

jmgrassau added a commit to jmgrassau/abap-cleaner that referenced this issue Jan 5, 2024
@jmgrassau
Copy link
Member

Hi Kjetil,

thanks again for pointing this out – alignment of ENUMs should now work with version 1.13.0!

Kind regards,
Jörg-Michael

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

No branches or pull requests

2 participants