Skip to content

Commit 4bd052c

Browse files
committed
Fixed typo, initialiser.
1 parent 049828c commit 4bd052c

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
@@ -71,7 +71,7 @@ public struct Configuration: Codable, Equatable {
7171
/// MARK: Common configuration
7272

7373
/// Is all formatting disbled?
74-
public var allDisabled: Bool
74+
public var allDisabled = false
7575

7676
/// The dictionary containing the rule names that we wish to run on. A rule is not used if it is
7777
/// marked as `false`, or if it is missing from the dictionary.
@@ -277,7 +277,9 @@ public struct Configuration: Codable, Equatable {
277277
/// Creates a new `Configuration` by loading it from a configuration file.
278278
public init(contentsOf url: URL) throws {
279279
if url.lastPathComponent == Self.suppressionFileName {
280-
self = Configuration(allDisabled: true)
280+
var config = Configuration()
281+
config.allDisabled = true
282+
self = config
281283
return
282284
}
283285

@@ -315,7 +317,7 @@ public struct Configuration: Codable, Equatable {
315317
let defaults = Configuration()
316318

317319
self.allDisabled =
318-
try container.decideIfPresent(Bool.self, forKey: .allDisabled)
320+
try container.decodeIfPresent(Bool.self, forKey: .allDisabled)
319321
?? false
320322
self.maximumBlankLines =
321323
try container.decodeIfPresent(Int.self, forKey: .maximumBlankLines)

0 commit comments

Comments
 (0)