Multiline Parameters Brackets

Multiline parameters should have their surrounding brackets in a new line

  • Identifier: multiline_parameters_brackets
  • Enabled by default: No
  • Supports autocorrection: No
  • Kind: style
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

func foo(param1: String, param2: String, param3: String)
func foo(
    param1: String, param2: String, param3: String
)
func foo(
    param1: String,
    param2: String,
    param3: String
)
class SomeType {
    func foo(param1: String, param2: String, param3: String)
}
class SomeType {
    func foo(
        param1: String, param2: String, param3: String
    )
}
class SomeType {
    func foo(
        param1: String,
        param2: String,
        param3: String
    )
}
func foo<T>(param1: T, param2: String, param3: String) -> T { /* some code */ }
    func foo(a: [Int] = [
        1
    ])

Triggering Examples

func foo(param1: String, param2: String,
         param3: String
)
func foo(
    param1: String,
    param2: String,
    param3: String)
class SomeType {
    func foo(param1: String, param2: String,
             param3: String
    )
}
class SomeType {
    func foo(
        param1: String,
        param2: String,
        param3: String)
}
func foo<T>(param1: T, param2: String,
         param3: String
) -> T