Skip to content

Commit c2bb934

Browse files
committed
Change flag to skipAll.
1 parent fc2e249 commit c2bb934

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Documentation/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ top-level keys and values:
1111
* `version` _(number)_: The version of the configuration file. For now, this
1212
should always be `1`.
1313

14-
* `allDisabled` _(boolean)_: If this is true, all other configuration
14+
* `skipAll` _(boolean)_: If this is true, all other configuration
1515
options are ignored, and formatting is disabled.
1616

1717
* `lineLength` _(number)_: The maximum allowed length of a line, in

Sources/SwiftFormat/API/Configuration.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public struct Configuration: Codable, Equatable {
3636

3737
private enum CodingKeys: CodingKey {
3838
case version
39-
case allDisabled
39+
case skipAll
4040
case maximumBlankLines
4141
case lineLength
4242
case spacesBeforeEndOfLineComments
@@ -71,7 +71,7 @@ public struct Configuration: Codable, Equatable {
7171
/// MARK: Common configuration
7272

7373
/// Is all formatting disbled?
74-
public var allDisabled = false
74+
public var skipAll = 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.
@@ -278,7 +278,7 @@ public struct Configuration: Codable, Equatable {
278278
public init(contentsOf url: URL) throws {
279279
if url.lastPathComponent == Self.suppressionFileName {
280280
var config = Configuration()
281-
config.allDisabled = true
281+
config.skipAll = true
282282
self = config
283283
return
284284
}
@@ -316,8 +316,8 @@ public struct Configuration: Codable, Equatable {
316316
// default-initialized instance.
317317
let defaults = Configuration()
318318

319-
self.allDisabled =
320-
try container.decodeIfPresent(Bool.self, forKey: .allDisabled)
319+
self.skipAll =
320+
try container.decodeIfPresent(Bool.self, forKey: .skipAll)
321321
?? false
322322
self.maximumBlankLines =
323323
try container.decodeIfPresent(Int.self, forKey: .maximumBlankLines)
@@ -406,7 +406,7 @@ public struct Configuration: Codable, Equatable {
406406
var container = encoder.container(keyedBy: CodingKeys.self)
407407

408408
try container.encode(version, forKey: .version)
409-
try container.encode(allDisabled, forKey: .allDisabled)
409+
try container.encode(skipAll, forKey: .skipAll)
410410
try container.encode(maximumBlankLines, forKey: .maximumBlankLines)
411411
try container.encode(lineLength, forKey: .lineLength)
412412
try container.encode(spacesBeforeEndOfLineComments, forKey: .spacesBeforeEndOfLineComments)

Sources/SwiftFormat/API/SwiftFormatter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public final class SwiftFormatter {
106106
// also does not touch an empty file even if the setting to add trailing newlines is enabled.)
107107
guard !source.isEmpty else { return }
108108

109-
// If allDisabled is set, just emit the source as-is.
110-
guard !configuration.allDisabled else {
109+
// If skipAll is set, just emit the source as-is.
110+
guard !configuration.skipAll else {
111111
outputStream.write(source)
112112
return
113113
}

Sources/SwiftFormat/API/SwiftLinter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public final class SwiftLinter {
9494
// also does not touch an empty file even if the setting to add trailing newlines is enabled.)
9595
guard !source.isEmpty else { return }
9696

97-
// If allDisabled is set, do nothing.
98-
guard !configuration.allDisabled else {
97+
// If skipAll is set, do nothing.
98+
guard !configuration.skipAll else {
9999
return
100100
}
101101

0 commit comments

Comments
 (0)