Skip to content
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

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

Closed
FirdousP opened this issue Aug 31, 2023 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@FirdousP
Copy link

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

@jmgrassau jmgrassau added the documentation Improvements or additions to documentation label Sep 22, 2023
@jmgrassau
Copy link
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

@ConjuringCoffee
Copy link
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

@jmgrassau jmgrassau self-assigned this Sep 22, 2023
jmgrassau added a commit to jmgrassau/abap-cleaner that referenced this issue Sep 22, 2023
@jmgrassau
Copy link
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
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants