diff --git a/Rules.md b/Rules.md index 2fda70f53..173e2fed5 100644 --- a/Rules.md +++ b/Rules.md @@ -2510,6 +2510,7 @@ Option | Description `--wrapparameters` | Wrap func params: "before-first", "after-first", "preserve" `--wrapcollections` | Wrap array/dict: "before-first", "after-first", "preserve" `--closingparen` | Closing paren position: "balanced" (default) or "same-line" +`--callsiteparen` | Closing paren at call site: "inherit" (default) or "same-line" `--wrapreturntype` | Wrap return type: "if-multiline", "preserve" (default) `--wrapconditions` | Wrap conditions: "before-first", "after-first", "preserve" `--wraptypealiases` | Wrap typealiases: "before-first", "after-first", "preserve" diff --git a/Sources/OptionDescriptor.swift b/Sources/OptionDescriptor.swift index ec6bc60f6..81c2e156d 100644 --- a/Sources/OptionDescriptor.swift +++ b/Sources/OptionDescriptor.swift @@ -511,11 +511,11 @@ struct _Descriptors { falseValues: ["balanced"] ) let forceClosingParenOnSameLineForFunctionCalls = OptionDescriptor( - argumentName: "closingparenfcall", + argumentName: "callsiteparen", displayName: "Force Closing Paren on same line for function calls", - help: "Force the closingParenOnSameLine option specifically for function calls: \"inherit\" (default) or \"force-same-line\"", + help: "Closing paren at call site: \"inherit\" (default) or \"same-line\"", keyPath: \.forceClosingParenOnSameLineForFunctionCalls, - trueValues: ["force-same-line", "same-line"], + trueValues: ["same-line"], falseValues: ["inherit"] ) let uppercaseHex = OptionDescriptor( diff --git a/Sources/Rules.swift b/Sources/Rules.swift index fd0605f53..af836c90b 100644 --- a/Sources/Rules.swift +++ b/Sources/Rules.swift @@ -3780,8 +3780,9 @@ public struct _FormatRules { public let wrap = FormatRule( help: "Wrap lines that exceed the specified maximum width.", options: ["maxwidth", "nowrapoperators", "assetliterals", "wrapternary"], - sharedOptions: ["wraparguments", "wrapparameters", "wrapcollections", "closingparen", "indent", - "trimwhitespace", "linebreaks", "tabwidth", "maxwidth", "smarttabs", "wrapreturntype", "wrapconditions", "wraptypealiases", "wrapternary", "wrapeffects", "conditionswrap"] + sharedOptions: ["wraparguments", "wrapparameters", "wrapcollections", "closingparen", "callsiteparen", "indent", + "trimwhitespace", "linebreaks", "tabwidth", "maxwidth", "smarttabs", "wrapreturntype", + "wrapconditions", "wraptypealiases", "wrapternary", "wrapeffects", "conditionswrap"] ) { formatter in let maxWidth = formatter.options.maxWidth guard maxWidth > 0 else { return } @@ -3837,9 +3838,8 @@ public struct _FormatRules { public let wrapArguments = FormatRule( help: "Align wrapped function arguments or collection elements.", orderAfter: ["wrap"], - options: ["wraparguments", "wrapparameters", "wrapcollections", "closingparen", - "wrapreturntype", "wrapconditions", "wraptypealiases", "wrapeffects", - "conditionswrap"], + options: ["wraparguments", "wrapparameters", "wrapcollections", "closingparen", "callsiteparen", + "wrapreturntype", "wrapconditions", "wraptypealiases", "wrapeffects", "conditionswrap"], sharedOptions: ["indent", "trimwhitespace", "linebreaks", "tabwidth", "maxwidth", "smarttabs", "assetliterals", "wrapternary"] ) { formatter in diff --git a/Tests/MetadataTests.swift b/Tests/MetadataTests.swift index 63fe5e1e7..3836289bd 100644 --- a/Tests/MetadataTests.swift +++ b/Tests/MetadataTests.swift @@ -195,7 +195,8 @@ class MetadataTests: XCTestCase { case .identifier("wrapCollectionsAndArguments"): referencedOptions += [ Descriptors.wrapArguments, Descriptors.wrapParameters, Descriptors.wrapCollections, - Descriptors.closingParenOnSameLine, Descriptors.linebreak, Descriptors.truncateBlankLines, + Descriptors.closingParenOnSameLine, Descriptors.forceClosingParenOnSameLineForFunctionCalls, + Descriptors.linebreak, Descriptors.truncateBlankLines, Descriptors.indent, Descriptors.tabWidth, Descriptors.smartTabs, Descriptors.maxWidth, Descriptors.assetLiteralWidth, Descriptors.wrapReturnType, Descriptors.wrapEffects, Descriptors.wrapConditions, Descriptors.wrapTypealiases, Descriptors.wrapTernaryOperators, Descriptors.conditionsWrap,