Skip to content

Indentation of CATCH with multiple exception classes #376

Closed

Description

@vonglan

Hi,
it seems this does not work yet.

      CATCH zcx_ycf_data_not_found
    cx_sy_conversion_no_number.
        granularity = -1.
    ENDTRY.

I would like:

      CATCH zcx_ycf_data_not_found
            cx_sy_conversion_no_number.
        granularity = -1.
    ENDTRY.

or

      CATCH zcx_ycf_data_not_found cx_sy_conversion_no_number.
        granularity = -1.
    ENDTRY.

Best regards,
Edo

Activity

  1. jmgrassau commented on Dec 6, 2024

    @jmgrassau
    Member

    Hi Edo,

    good idea – this could either be a new cleanup rule, or we could add it to "Align CLEAR:, FREE: and SORT", with a similar selection ("Use one line per exception class: Always | Never" + maximum line length)

    Kind regards,
    Jörg-Michael

  2. vonglan commented on Dec 9, 2024

    @vonglan
    Author

    Hi Jörg-Michael,
    I think this is similar to SORT. So either include in existing rule, or split this into two rules (CLEAR+FREE vs SORT+CATCH)
    Best regards,
    Edo

  3. self-assigned this
    on Dec 9, 2024
  4. jmgrassau commented on Dec 9, 2024

    @jmgrassau
    Member

    Hi Edo,

    I think this still fits quite well into the same rule, so we now have:

    image

    Or alternatively, using the "Maximum line length" setting:

    image

    I also added a "keep as is" option to all four combo boxes, in case someone only wants to align some of these statements.

    Kind regards,
    Jörg-Michael

  5. jmgrassau commented on Dec 16, 2024

    @jmgrassau
    Member

    Hi Edo,

    hope this works fine now – you can try it out with version 1.21.0, which was just released!

    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