Skip to content

Commit 1454d46

Browse files
committed
- PR add DocC header for configuration setting
1 parent f7140e9 commit 1454d46

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Sources/SwiftFormat/API/Configuration.swift

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,27 @@ public struct Configuration: Codable, Equatable {
163163
/// Contains exceptions for the `NoAssignmentInExpressions` rule.
164164
public var noAssignmentInExpressions: NoAssignmentInExpressionsConfiguration
165165

166-
/// Determines whether multi-element collection literals should have trailing commas.
166+
/// Determines if multi-element collection literals should have trailing commas.
167+
///
168+
/// When `true` (default), the correct form is:
169+
/// ```swift
170+
/// let MyCollection = [1, 2,]
171+
/// ...
172+
/// let MyCollection = [
173+
/// "a": 1,
174+
/// "b": 2,
175+
/// ]
176+
/// ```
177+
///
178+
/// When `false`, the correct form is:
179+
/// ```swift
180+
/// let MyCollection = [1, 2]
181+
/// ...
182+
/// let MyCollection = [
183+
/// "a": 1,
184+
/// "b": 2
185+
/// ]
186+
/// ```
167187
public var multiElementCollectionTrailingCommas: Bool
168188

169189
/// Constructs a Configuration by loading it from a configuration file.

0 commit comments

Comments
 (0)