这是indexloc提供的服务,不要输入任何密码
Skip to content

Function calls format #366

@trozware

Description

@trozware

The current style guide states that when a function call is wrapped on to multiple lines, the closing parenthesis should be on the same line as the last parameter, like this:

let id = getPersonID(
  name: "Bob",
  age: 42,
  registered: true,
  note: "Bob is not a real person.")

Xcode 15 has a new Refactor > Format to Multiple Lines option and it places the closing bracket on a line of its own, as shown here:

let id = getPersonID(
  name: "Bob",
  age: 42,
  registered: true,
  note: "Bob is not a real person."
)

I recommend changing the Kodeco style to match what Xcode produces.

Note that Xcode multi-lines function definitions in exactly the way the current style guide uses. It is only the function call style that it changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions