Skip to content

Allow multiple lines in parameter destructuring with V2 strict parser #6783

@cgoina

Description

@cgoina

New feature

With v1 parser I could have this in map:

    | multiMap { it ->
        def (reg_meta,

            local_fix, local_fix_subpath,
            local_mov, local_mov_subpath,

            local_fix_mask, local_fix_mask_subpath,
            local_mov_mask, local_mov_mask_subpath,

            global_transform,

            local_steps,
            local_registration_working_dir, // local_transform_output
            local_transform_name, local_transform_subpath,
            local_inv_transform_name, local_inv_transform_subpath,

            local_registration_output, // local_align_output
            local_align_name, local_align_subpath,

            dask_meta, dask_context) = it
            ....
  • which makes the code very readable.

With V2 strict I have to have everything in a single line which makes it completely unreadable. I know that for now I still have the option to use V1, but for how long and when this is gone this code becomes unmaintainable. I could add comments, separate parameters into semantic groups, which made everything clean and clear IMO.

Use case

Code becomes completely unreadable when there are a lot of parameters.

Suggested implementation

Just keep the current groovy destructuring or improve the parser to allow white space, comments, etc. I have not looked at the parser code to be able to suggest a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions