Skip to content

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

Closed

Description

@fabianlupa

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?

Activity

  1. self-assigned this
    on Dec 10, 2024
  2. jmgrassau commented on Dec 10, 2024

    @jmgrassau
    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

  3. jmgrassau commented on Dec 16, 2024

    @jmgrassau
    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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions