Skip to content

If an argument in a function call is multi-lined, break up all the arguments #276

Description

@archiif

If an argument within a function call is going to be broken up into multiple lines, the entire series of arguments should also be broken up. So instead of this:

function_call(arg_1, more_args, function()
    more_function_call(arg)
end)

function_call({
        key = value,
        key = value,
        key = value,
        key = value,
        key = value,
}, arg_1, more_args)

I think it's more readable like this:

function_call(
    arg_1,
    more_args,
    function()
        more_function_call(arg)
    end
)

function_call(
    {
        key = value,
        key = value,
        key = value,
        key = value,
        key = value,
    },
    arg_1,
    more_args
)

Again, the styling is referenced from black.
Sorry for the combo of issues, just got a bit excited knowing that there's at least one good Lua formatter out there :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrfc/in discussionThis issue is currently in discussion, comments are welcome!

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions