Skip to content

Automatic splitting / joining lines respecting max length #78

Closed
@ddickstein

Description

@ddickstein

It would be great if there were an option to automatically split and join lines to respect a max length where the line is split when the max length is exceeded and joined when it can all be fit on a single line without exceeding max length. How to split expressions is of course quite opinionated, so this would probably need to be controlled by multiple options. For example, one might want to support:

local x = {
  foo,
  bar,
  baz,
}

and

local x =
  { foo, bar, baz }

but never

local x =
  { foo, bar,
     baz }

I'm not sure how many options are needed here to satisfy all the different kinds of layouts people might want to allow and disallow (e.g., whether baz in the first example there should always / never end in a comma, whether to use trailing or leading commas, etc.) and I haven't thought too much about other kinds of expressions.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions