Skip to content

Commit 021d6b3

Browse files
committed
Fixed typo, initialiser.
1 parent 356b55f commit 021d6b3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/SwiftFormat/API/Configuration.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public struct Configuration: Codable, Equatable {
7272
/// MARK: Common configuration
7373

7474
/// Is all formatting disbled?
75-
public var allDisabled: Bool
75+
public var allDisabled = false
7676

7777
/// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
7878
/// marked as `false`, or if it is missing from the dictionary.
@@ -285,7 +285,9 @@ public struct Configuration: Codable, Equatable {
285285
/// Creates a new `Configuration` by loading it from a configuration file.
286286
public init(contentsOf url: URL) throws {
287287
if url.lastPathComponent == Self.suppressionFileName {
288-
self = Configuration(allDisabled: true)
288+
var config = Configuration()
289+
config.allDisabled = true
290+
self = config
289291
return
290292
}
291293

@@ -323,7 +325,7 @@ public struct Configuration: Codable, Equatable {
323325
let defaults = Configuration()
324326

325327
self.allDisabled =
326-
try container.decideIfPresent(Bool.self, forKey: .allDisabled)
328+
try container.decodeIfPresent(Bool.self, forKey: .allDisabled)
327329
?? false
328330
self.maximumBlankLines =
329331
try container.decodeIfPresent(Int.self, forKey: .maximumBlankLines)

0 commit comments

Comments
 (0)