Skip to content

Comments not aligned after the line length(80) & declarations surpassing the line length(80) #100

Closed

Description

@FirdousP

Hi ,

Issue1:The constant declaration/code surpasses the 80 line length.
image

Expectation:
When any code written exceeds 80, it should ideally be in next line.

Issue 2: The comments are not aligned properly.
image

Expectation:
The comment though written before or after the line length should all be aligned.
image

Activity

  1. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi FirdousP,

    I do see your point, but unfortunately, this is currently a limitation of the tabular alignment in ABAP cleaner: In the cleanup rule "Align declarations", the recently added option…

    image

    … only works if the VALUE clause is the last "column" of the to-be-aligned "table". In the case of your example, the line-end comments would be another "column", and that's why the VALUE can't be moved. I shall add some documentation on this:

    image

    Regarding issue 2, this is out of scope, because as far as I can see from your second screenshot, these are inline declarations, while the "Align declarations" rule only processes upfront declarations. There is currently no general cleanup rule for exceeded line length or for alignment of line-end comments.

    Kind regards,
    Jörg-Michael

  2. ConjuringCoffee commented on Sep 22, 2023

    @ConjuringCoffee
    Contributor

    Adding to the topic of issue 2: Comments at the end of lines are considered bad practice by the Clean ABAP style guide:

    https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to

  3. self-assigned this
    on Sep 22, 2023
  4. jmgrassau commented on Sep 22, 2023

    @jmgrassau
    Member

    Hi FirdousP,

    sorry there is no better solution for this at the moment – but nevertheless thanks, and at least this limitation is now documented.

    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

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions