mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
Add --trailingcommas collections-only option to opt out of Swift 6.1 trailing comma support (#2081)
Co-authored-by: Cal Stephens <cal.stephens@airbnb.com>
This commit is contained in:
committed by
Cal Stephens
parent
d2fba2c7fe
commit
a65ea804ca
@@ -516,12 +516,10 @@ struct _Descriptors {
|
||||
falseValues: ["false"]
|
||||
)
|
||||
let trailingCommas = OptionDescriptor(
|
||||
argumentName: "commas",
|
||||
displayName: "Commas",
|
||||
help: "Commas in collection literals: \"always\" (default) or \"inline\"",
|
||||
keyPath: \.trailingCommas,
|
||||
trueValues: ["always", "true"],
|
||||
falseValues: ["inline", "false"]
|
||||
argumentName: "trailingcommas",
|
||||
displayName: "Trailing commas",
|
||||
help: "Trailing commas: \"always\" (default), \"never\", or \"collections-only\"",
|
||||
keyPath: \.trailingCommas
|
||||
)
|
||||
let truncateBlankLines = OptionDescriptor(
|
||||
argumentName: "trimwhitespace",
|
||||
@@ -1361,6 +1359,18 @@ struct _Descriptors {
|
||||
deprecationMessage: "Use with `--storedvarattributes` or `--computedvarattributes` instead.",
|
||||
keyPath: \.varAttributes
|
||||
)
|
||||
let commas = OptionDescriptor(
|
||||
argumentName: "commas",
|
||||
displayName: "Trailing commas",
|
||||
help: "deprecated",
|
||||
deprecationMessage: "Use '--trailingcommas' instead",
|
||||
keyPath: \.trailingCommas,
|
||||
altOptions: [
|
||||
"inline": .never,
|
||||
"false": .never,
|
||||
"true": .always,
|
||||
]
|
||||
)
|
||||
|
||||
// MARK: - RENAMED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user