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

Align parameters and components: Minimum line length is 80 #362

Closed
fabianlupa opened this issue Sep 25, 2024 · 2 comments
Closed

Align parameters and components: Minimum line length is 80 #362

fabianlupa opened this issue Sep 25, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@fabianlupa
Copy link

Hi, I am looking for a setting to change the maximum line width to make ABAP cleaner automatically add line breaks where necessary (and also to prevent it from removing ones that were added manually). I found the rule "Align parameters and components" which has multiple settings for maximum line length:

image

The minimum seems to be 80 though. If I enter for example 61 it automatically resets to 80 after focus lost. 61 is way too low for any normal development, however, in printed literature that's the maximum that may fit on a line on a page.

Is there any technical reason for 80 being the minimum? Also are there any other rules I need to adjust?

@jmgrassau jmgrassau added the enhancement New feature or request label Dec 10, 2024
@jmgrassau jmgrassau self-assigned this Dec 10, 2024
@jmgrassau
Copy link
Member

Hi Fabian,

running ABAP cleaner to format code for printing is an interesting use case – and yes, 80 is somehow an arbitrary limit, so I now changed that to 60 (with the next release). Note, however, that ABAP cleaner does not guarantee to achieve this "Maximum line length" setting. It is rather a kind of 'decision help' for specific code places, where ABAP cleaner can decide whether to continue the line or to break to the next line. So, manual rework will still be needed, but maybe ABAP cleaner can help to reduce that. 60 chars is indeed very tight, given identifiers of 30 chars length.

You can find similar settings in the following places:

ABAP:

  • Standardize CLASS ... DEFINITION
  • Align declarations
  • Align CLEAR:, FREE:, SORT and CATCH
  • Align SELECT clauses
  • Align SELECT lists
  • Align parameters and components
  • Align conditional expressions
  • Align PERFORM parameters

DDL:

  • Standardize annotation layout
  • Align name list and GROUP BY list

(Yes, it might make sense to centralize these settings somewhere on the UI – currently, this is decentralized simply because we lack the "general configuration" place that applies for multiple rules).

Kind regards,
Jörg-Michael

@jmgrassau
Copy link
Member

Hi Fabian,

version 1.21.0, which was just released, now allows to lower the "maximum line length" to 60! As mentioned, this is no guarantee, but hopefully helps to reduce manual effort.

Kind regards,
Jörg-Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants